Struct nat_traversal::MappedTcpSocket
[−]
[src]
pub struct MappedTcpSocket { pub socket: TcpBuilder, pub endpoints: Vec<MappedSocketAddr>, }
A tcp socket for which we know our external endpoints.
Fields
socket: TcpBuilder
A bound, but neither listening or connected tcp socket. The socket is bound to be reuseable (ie. SO_REUSEADDR is set as is SO_REUSEPORT on unix).
endpoints: Vec<MappedSocketAddr>
The known endpoints of this socket.
Methods
impl MappedTcpSocket
[src]
fn map(socket: TcpBuilder, mc: &MappingContext, deadline: Instant) -> WResult<MappedTcpSocket, MappedTcpSocketMapWarning, MappedTcpSocketMapError>
Map an existing tcp socket. The socket must bound but not connected. It must have been bound with SO_REUSEADDR and SO_REUSEPORT options (or equivalent) set.
fn new(mc: &MappingContext, deadline: Instant) -> WResult<MappedTcpSocket, MappedTcpSocketMapWarning, MappedTcpSocketNewError>
Create a new MappedTcpSocket