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
| Return | Name | Description |
|---|---|---|
TCPAllocation & | allocation | |
net::SocketEmitter | client | |
net::SocketEmitter | peer | |
Buffer | earlyPeerData | |
uint32_t | connectionID | |
bool | isDataConnection | |
bool | pendingDelete | |
Timeout | timeout | |
stun::TransactionID | transactionID |
allocation
TCPAllocation & allocationclient
net::SocketEmitter clientpeer
net::SocketEmitter peerearlyPeerData
Buffer earlyPeerDataconnectionID
uint32_t connectionIDisDataConnection
bool isDataConnectionpendingDelete
bool pendingDelete = falsetimeout
Timeout timeouttransactionID
stun::TransactionID transactionIDPublic Methods
| Return | Name | Description |
|---|---|---|
TCPConnectionPair | Constructs a pair with a randomly assigned connection ID. The caller must add the pair to the allocation's pair map. | |
bool | doPeerConnect | |
bool | makeDataConnection | |
void | setPeerSocket | |
void | setClientSocket | |
bool | onPeerConnectSuccess | |
bool | onPeerConnectError | |
bool | onClientDataReceived | |
bool | onPeerDataReceived | |
bool | onConnectionClosed | |
void | startTimeout | |
void | requestDeletion | |
bool | expired 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
allocationThe TCPAllocation that owns this pair.
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() constPublic Types
| Name | Description |
|---|---|
Ptr |
Ptr
IntrusivePtr< TCPConnectionPair > Ptr()Private Methods
| Return | Name | Description |
|---|---|---|
TCPConnectionPair | Deleted constructor. | |
TCPConnectionPair | Deleted constructor. |
TCPConnectionPair
TCPConnectionPair(const TCPConnectionPair &) = deleteDeleted constructor.
TCPConnectionPair
TCPConnectionPair(TCPConnectionPair &&) = deleteDeleted constructor.
