TURN module (rfc5766)

TCPConnectionPair

Paired TCP connections forming a single TURN relay pipe between a client and a peer.

TCPConnectionPair

#include <icy/turn/server/tcpconnectionpair.h>

Inherits: RefCounted< TCPConnectionPair >

Paired TCP connections forming a single TURN relay pipe between a client and a peer. Lifetime managed by IntrusivePtr; the owning TCPAllocation holds the Ptr in its pair map.

Public Attributes

ReturnNameDescription
TCPAllocation &allocation
net::SocketEmitterclient
net::SocketEmitterpeer
BufferearlyPeerData
uint32_tconnectionID
boolisDataConnection
boolpendingDelete
Timeouttimeout
stun::TransactionIDtransactionID

allocation

TCPAllocation & allocation

client

net::SocketEmitter client

peer

net::SocketEmitter peer

earlyPeerData

Buffer earlyPeerData

connectionID

uint32_t connectionID

isDataConnection

bool isDataConnection

pendingDelete

bool pendingDelete = false

timeout

Timeout timeout

transactionID

stun::TransactionID transactionID

Public Methods

ReturnNameDescription
TCPConnectionPairConstructs a pair with a randomly assigned connection ID. The caller must add the pair to the allocation's pair map.
booldoPeerConnect
boolmakeDataConnection
voidsetPeerSocket
voidsetClientSocket
boolonPeerConnectSuccess
boolonPeerConnectError
boolonClientDataReceived
boolonPeerDataReceived
boolonConnectionClosed
voidstartTimeout
voidrequestDeletion
boolexpired const

TCPConnectionPair

TCPConnectionPair(TCPAllocation & allocation)

Constructs a pair with a randomly assigned connection ID. The caller must add the pair to the allocation's pair map.

Parameters


doPeerConnect

bool doPeerConnect(const net::Address & peerAddr)

makeDataConnection

bool makeDataConnection()

setPeerSocket

void setPeerSocket(const net::TCPSocket::Ptr & socket)

setClientSocket

void setClientSocket(const net::TCPSocket::Ptr & socket)

onPeerConnectSuccess

bool onPeerConnectSuccess(net::Socket & socket)

onPeerConnectError

bool onPeerConnectError(net::Socket & socket, const Error & error)

onClientDataReceived

bool onClientDataReceived(net::Socket & socket, const MutableBuffer & buffer, const net::Address & peerAddress)

onPeerDataReceived

bool onPeerDataReceived(net::Socket & socket, const MutableBuffer & buffer, const net::Address & peerAddress)

onConnectionClosed

bool onConnectionClosed(net::Socket & socket)

startTimeout

void startTimeout()

requestDeletion

void requestDeletion()

expired

const

bool expired() const

Public Types

NameDescription
Ptr

Ptr

IntrusivePtr< TCPConnectionPair > Ptr()

Private Methods

ReturnNameDescription
TCPConnectionPairDeleted constructor.
TCPConnectionPairDeleted constructor.

TCPConnectionPair

TCPConnectionPair(const TCPConnectionPair &) = delete

Deleted constructor.


TCPConnectionPair

TCPConnectionPair(TCPConnectionPair &&) = delete

Deleted constructor.