Crate cap_net_ext

Source
Expand description

Extension traits for TcpListener, UdpSocket, and Pool.

cap-std’s TcpListener, following the Rust standard library TcpListener, combines the socket, bind, listen, and connect operations of the POSIX socket API into a single bind or connect operation. In some use cases, it’s desirable to perform the steps separately.

This API adds extension traits to cap-std’s TcpListener, UdpSocket, and Pool which support the following sequence for accepting incoming connections:

and the following sequence for initiating outgoing connections:

TcpListenerExt::new and TcpListener::accept_with additionally have Blocking arguments for requesting non-blocking operation.

Similar API adaptations are available for UDP sockets as well.

Structs§

TcpBinder
A utility for binding TCP listeners.
TcpConnecter
A utility for making TCP connections.
UdpBinder
A utility for binding UDP sockets.
UdpConnecter
A utility for making UDP connections.

Enums§

AddressFamily
Address families supported by TcpListenerExt::new and UdpSocketExt::new.
Blocking
Select blocking or non-blocking mode.

Traits§

PoolExt
A trait for extending Pool types.
TcpListenerExt
A trait for extending TcpListener types.
UdpSocketExt
A trait for extending UdpSocket types.