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<MappedTcpSocketMappedTcpSocketMapWarningMappedTcpSocketMapError>

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<MappedTcpSocketMappedTcpSocketMapWarningMappedTcpSocketNewError>

Create a new MappedTcpSocket