Struct uflow::server::Server

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

Acts as a host for inbound uflow connections.

Implementations§

Opens a non-blocking UDP socket bound to the provided address, and returns a corresponding Server object.

Error Handling

Any errors resulting from socket initialization are forwarded to the caller. This function will panic if the provided server configuration is not valid.

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

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

Returns the local address of the internal UDP socket.

Flushes outbound frames, then processes as many inbound frames as possible from the internal socket. Returns an iterator of Event objects to signal connection events and deliver received packets for each client.

Note 1: All events are considered delivered, even if the iterator is not consumed until the end.

Note 2: Internally, uflow uses the leaky bucket algorithm to control the rate at which UDP frames are sent. To ensure that data is transferred smoothly, this function should be called regularly and relatively frequently.

Sends as many outbound frames as possible for each client.

Returns a reference to the RemoteClient with the given address. Returns None if no such client exists.

Immediately terminates the connection with the given address. No further data will be sent or received, and a timeout error will be generated on the client.

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.