TCPClientObserver
#include <icy/turn/client/tcpclient.h>
struct TCPClientObserverDefined in src/turn/include/icy/turn/client/tcpclient.h:31
- Inherits
ClientObserver
Observer interface for TCP TURN client events (RFC 6062). Extends ClientObserver with callbacks specific to TCP relay connections.
List of all members
| Name | Kind | Owner |
|---|---|---|
onRelayConnectionCreated | function | Declared here |
onRelayConnectionError | function | Declared here |
onRelayConnectionClosed | function | Declared here |
onRelayConnectionBindingFailed | function | Declared here |
onPeerConnectionAttempt | function | Declared here |
onClientStateChange | function | Inherited from ClientObserver |
onRelayDataReceived | function | Inherited from ClientObserver |
onAllocationFailed | function | Inherited from ClientObserver |
onAllocationDeleted | function | Inherited from ClientObserver |
onAllocationPermissionsCreated | function | Inherited from ClientObserver |
onTransactionResponse | function | Inherited from ClientObserver |
onTimer | function | Inherited from ClientObserver |
Inherited from ClientObserver
| Kind | Name | Description |
|---|---|---|
function | onClientStateChange virtual | Called whenever the client's state machine transitions to a new state. |
function | onRelayDataReceived virtual | Called when relayed data is received from a peer via a Data Indication. |
function | onAllocationFailed virtual inline | Called when the server rejects an Allocate request with an error. |
function | onAllocationDeleted virtual inline | Called when the server confirms deletion of the allocation. |
function | onAllocationPermissionsCreated virtual inline | Called after a CreatePermission request succeeds. |
function | onTransactionResponse virtual inline | All received transaction responses will be routed here after local processing so the observer can easily implement extra functionality. |
function | onTimer virtual inline | Fires after the client's internal timer callback. Handy for performing extra async cleanup tasks. |
Public Methods
| Return | Name | Description |
|---|---|---|
void | onRelayConnectionCreated virtual | Called when a ConnectionBind succeeds and the relay pipe is live. |
void | onRelayConnectionError virtual inline | Called when an error occurs on a relay connection socket. |
void | onRelayConnectionClosed virtual | Called when a relay connection socket is closed. |
void | onRelayConnectionBindingFailed virtual inline | Called when a Connect request (client-initiated) or a ConnectionBind handshake fails for the given peer. |
bool | onPeerConnectionAttempt virtual inline | Called when the server sends a ConnectionAttempt indication indicating that a remote peer wants to connect. Return true to accept the connection (proceeds with ConnectionBind), or false to reject it. |
onRelayConnectionCreated
virtual
virtual void onRelayConnectionCreated(TCPClient & client, const net::TCPSocket::Ptr & socket, const net::Address & peerAddress)Defined in src/turn/include/icy/turn/client/tcpclient.h:38
Called when a ConnectionBind succeeds and the relay pipe is live.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | TCPClient & | The owning TCP client. |
socket | const net::TCPSocket::Ptr & | The TCP socket that is now connected to the TURN server and ready for direct data transfer to/from the peer. |
peerAddress | const net::Address & | The remote peer address associated with this connection. |
onRelayConnectionError
virtual inline
virtual inline void onRelayConnectionError(TCPClient & client, const net::TCPSocket::Ptr & socket, const net::Address & peerAddress)Defined in src/turn/include/icy/turn/client/tcpclient.h:44
Called when an error occurs on a relay connection socket.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | TCPClient & | The owning TCP client. |
socket | const net::TCPSocket::Ptr & | The affected socket. |
peerAddress | const net::Address & | The remote peer address for this connection. |
onRelayConnectionClosed
virtual
virtual void onRelayConnectionClosed(TCPClient & client, const net::TCPSocket::Ptr & socket, const net::Address & peerAddress)Defined in src/turn/include/icy/turn/client/tcpclient.h:50
Called when a relay connection socket is closed.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | TCPClient & | The owning TCP client. |
socket | const net::TCPSocket::Ptr & | The closed socket. |
peerAddress | const net::Address & | The remote peer address for this connection. |
onRelayConnectionBindingFailed
virtual inline
virtual inline void onRelayConnectionBindingFailed(TCPClient & client, const net::Address & peerAddress)Defined in src/turn/include/icy/turn/client/tcpclient.h:56
Called when a Connect request (client-initiated) or a ConnectionBind handshake fails for the given peer.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | TCPClient & | The owning TCP client. |
peerAddress | const net::Address & | The peer address whose binding failed. |
onPeerConnectionAttempt
virtual inline
virtual inline bool onPeerConnectionAttempt(TCPClient & client, const net::Address & peerAddress)Defined in src/turn/include/icy/turn/client/tcpclient.h:64
Called when the server sends a ConnectionAttempt indication indicating that a remote peer wants to connect. Return true to accept the connection (proceeds with ConnectionBind), or false to reject it.
Returns
true to accept and bind, false to ignore.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | TCPClient & | The owning TCP client. |
peerAddress | const net::Address & | The address of the connecting peer. |
