pub enum TurnServerPollRet {
WaitUntil(Instant),
AllocateSocket {
transport: TransportType,
listen_addr: SocketAddr,
client_addr: SocketAddr,
allocation_transport: TransportType,
family: AddressFamily,
},
TcpConnect {
relayed_addr: SocketAddr,
peer_addr: SocketAddr,
listen_addr: SocketAddr,
client_addr: SocketAddr,
},
TcpClose {
local_addr: SocketAddr,
remote_addr: SocketAddr,
},
SocketClose {
transport: TransportType,
listen_addr: SocketAddr,
},
}Expand description
Return value for poll.
Variants§
WaitUntil(Instant)
Wait until the specified time before calling poll() again.
AllocateSocket
Allocate a listening socket for a client specified by the client’s network 5-tuple.
Fields
transport: TransportTypeThe transport of the client asking for an allocation.
listen_addr: SocketAddrThe TURN server address of the client asking for an allocation.
client_addr: SocketAddrThe client local address of the client asking for an allocation.
allocation_transport: TransportTypeThe requested allocation transport.
family: AddressFamilyThe address family of the request for an allocation.
TcpConnect
Connect to a peer over TCP.
Fields
relayed_addr: SocketAddrThe relayed address to connect from.
peer_addr: SocketAddrThe peer to connect to.
listen_addr: SocketAddrThe TURN server address of the client asking for an allocation.
client_addr: SocketAddrThe client’s local address (TURN server remote) of the client asking for an allocation.
TcpClose
Close a TCP connection between the TURN server and a peer/client.
The connection can be in progress of being setup.
Connections to both TURN clients and peers can be signalled through this variant.
Fields
local_addr: SocketAddrThe socket address local to the TURN server.
remote_addr: SocketAddrThe socket address of the remote peer.
SocketClose
Stop listening on a socket.
Fields
transport: TransportTypeThe transport of the socket.
listen_addr: SocketAddrThe listening socket address.