pub struct Server { /* private fields */ }
Expand description

A polling-based socket object which manages inbound uflow connections.

Implementations

Opens a UDP socket and creates a corresponding Server object. The UDP socket is bound to the provided address, and configured to be non-blocking. Any errors resulting from socket initialization are forwarded to the caller.

The server will limit the number of concurrent, non-zombie connections to max_peer_count, and will silently ignore connection requests which would exceed that limit. Valid incoming connections will be initialized according to peer_config.

Equivalent to calling bind() with address (std::net::Ipv4Addr::UNSPECIFIED, 0).

Equivalent to calling bind() with address (std::net::Ipv6Addr::UNSPECIFIED, 0).

Returns a number of Peer objects representing new connections since the last call to incoming(). Any connections which have since entered the zombie state (timed out) will not be returned.

Processes UDP frames received since the last call to step(), and sends any pending outbound frames (acknowledgements, keep-alives, packet data, etc.).

Current, non-zombie Peer objects will be updated as relevant data is received. Call Peer::poll_events() after calling this method to retrieve incoming packets and connection status updates for an individual peer.

Sends any pending outbound frames (acknowledgements, keep-alives, packet data, etc.).

Returns the local address of the internal UDP socket.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.