SocketSelector

Multiplexer that allows to read from multiple sockets.

Constructors

this
this()

Default constructor.

Destructor

~this
~this()

Destructor.

Members

Functions

add
void add(TcpListener listener)

Add a new TcpListener to the selector.

add
void add(TcpSocket socket)

Add a new TcpSocket to the selector.

add
void add(UdpSocket socket)

Add a new UdpSocket to the selector.

clear
void clear()

Remove all the sockets stored in the selector.

isReady
bool isReady(TcpListener listener)
bool isReady(TcpSocket socket)
bool isReady(UdpSocket socket)

Test a socket to know if it is ready to receive data.

remove
void remove(TcpListener socket)

Remove a socket from the selector.

remove
void remove(TcpSocket socket)

Remove a socket from the selector.

remove
void remove(UdpSocket socket)

Remove a socket from the selector.

wait
bool wait(Duration timeout = Duration.zero())

Wait until one or more sockets are ready to receive.

Meta