TCPClientObserver
TCPClientObserver
#include <icy/turn/client/tcpclient.h>Inherits:
ClientObserver
Observer interface for TCP TURN client events (RFC 6062). Extends ClientObserver with callbacks specific to TCP relay connections.
Public Methods
| Return | Name | Description |
|---|---|---|
void | onRelayConnectionCreated | 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 | 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
void onRelayConnectionCreated(TCPClient & client, const net::TCPSocket::Ptr & socket, const net::Address & peerAddress)Called when a ConnectionBind succeeds and the relay pipe is live.
Parameters
clientThe owning TCP client.socketThe TCP socket that is now connected to the TURN server and ready for direct data transfer to/from the peer.peerAddressThe 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)Called when an error occurs on a relay connection socket.
Parameters
clientThe owning TCP client.socketThe affected socket.peerAddressThe remote peer address for this connection.
onRelayConnectionClosed
void onRelayConnectionClosed(TCPClient & client, const net::TCPSocket::Ptr & socket, const net::Address & peerAddress)Called when a relay connection socket is closed.
Parameters
clientThe owning TCP client.socketThe closed socket.peerAddressThe remote peer address for this connection.
onRelayConnectionBindingFailed
virtual inline
virtual inline void onRelayConnectionBindingFailed(TCPClient & client, const net::Address & peerAddress)Called when a Connect request (client-initiated) or a ConnectionBind handshake fails for the given peer.
Parameters
clientThe owning TCP client.peerAddressThe peer address whose binding failed.
onPeerConnectionAttempt
virtual inline
virtual inline bool onPeerConnectionAttempt(TCPClient & client, const net::Address & peerAddress)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.
Parameters
clientThe owning TCP client.peerAddressThe address of the connecting peer.
Returns
true to accept and bind, false to ignore.
