Home
TURN module (rfc5766)

TCPClientObserver

Observer interface for TCP TURN client events (RFC 6062).

TCPClientObserver

#include <icy/turn/client/tcpclient.h>
struct TCPClientObserver

Defined 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

NameKindOwner
onRelayConnectionCreatedfunctionDeclared here
onRelayConnectionErrorfunctionDeclared here
onRelayConnectionClosedfunctionDeclared here
onRelayConnectionBindingFailedfunctionDeclared here
onPeerConnectionAttemptfunctionDeclared here
onClientStateChangefunctionInherited from ClientObserver
onRelayDataReceivedfunctionInherited from ClientObserver
onAllocationFailedfunctionInherited from ClientObserver
onAllocationDeletedfunctionInherited from ClientObserver
onAllocationPermissionsCreatedfunctionInherited from ClientObserver
onTransactionResponsefunctionInherited from ClientObserver
onTimerfunctionInherited from ClientObserver

Inherited from ClientObserver

KindNameDescription
functiononClientStateChange virtualCalled whenever the client's state machine transitions to a new state.
functiononRelayDataReceived virtualCalled when relayed data is received from a peer via a Data Indication.
functiononAllocationFailed virtual inlineCalled when the server rejects an Allocate request with an error.
functiononAllocationDeleted virtual inlineCalled when the server confirms deletion of the allocation.
functiononAllocationPermissionsCreated virtual inlineCalled after a CreatePermission request succeeds.
functiononTransactionResponse virtual inlineAll received transaction responses will be routed here after local processing so the observer can easily implement extra functionality.
functiononTimer virtual inlineFires after the client's internal timer callback. Handy for performing extra async cleanup tasks.

Public Methods

ReturnNameDescription
voidonRelayConnectionCreated virtualCalled when a ConnectionBind succeeds and the relay pipe is live.
voidonRelayConnectionError virtual inlineCalled when an error occurs on a relay connection socket.
voidonRelayConnectionClosed virtualCalled when a relay connection socket is closed.
voidonRelayConnectionBindingFailed virtual inlineCalled when a Connect request (client-initiated) or a ConnectionBind handshake fails for the given peer.
boolonPeerConnectionAttempt virtual inlineCalled 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

  • client The owning TCP client.

  • socket The TCP socket that is now connected to the TURN server and ready for direct data transfer to/from the peer.

  • peerAddress 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

  • client The owning TCP client.

  • socket The affected socket.

  • peerAddress 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

  • client The owning TCP client.

  • socket The closed socket.

  • peerAddress 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

  • client The owning TCP client.

  • peerAddress 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.

Parameters

  • client The owning TCP client.

  • peerAddress The address of the connecting peer.

Returns

true to accept and bind, false to ignore.