#include <icy/stun/transaction.h>Inherits:
Transaction< Message >
STUN request/response transaction with timeout and retry logic. Extends the generic net::Transaction with STUN-specific transaction ID matching and response class inference (Success, Error, or Indication).
Lifetime is managed by IntrusivePtr. Create via makeIntrusive or wrap in IntrusivePtr immediately after construction.
| Return | Name | Description |
|---|---|---|
Transaction | Constructs a STUN transaction bound to a specific socket and peer. | |
bool | checkResponse | Checks that message is a valid response for the pending request. In addition to the base class check, verifies that the transaction IDs match. |
void | onResponse virtual | Called when a valid response is received. Infers the response class (SuccessResponse, ErrorResponse, or Indication) from the response attributes and delegates to the base class handler. |
Transaction(const net::Socket::Ptr & socket, const net::Address & peerAddress, long timeout, int retries)Constructs a STUN transaction bound to a specific socket and peer.
socket Socket used to send the request and receive the response.
peerAddress Remote address of the STUN/TURN server.
timeout Response timeout in milliseconds (default 10 s).
retries Number of send retries before declaring failure (default 1).
bool checkResponse(const Message & message)Checks that message is a valid response for the pending request. In addition to the base class check, verifies that the transaction IDs match.
message Incoming STUN message to evaluate.true if message is the expected response.
virtual
virtual void onResponse()Called when a valid response is received. Infers the response class (SuccessResponse, ErrorResponse, or Indication) from the response attributes and delegates to the base class handler.
| Name | Description |
|---|---|
Ptr |
IntrusivePtr< Transaction > Ptr()