A wrapper around native socket polling functionality for monitoring multiple sockets for I/O readiness.
This class provides a high-level abstraction over native poll
operations, allowing you to monitor sockets for read and write events.
Constructor
Variables
writeIndexes:Array<Int>
An array of indices corresponding to sockets ready for writing after polling.
Methods
events(?t:Float):Void
Waits for events on the prepared sockets.
Parameters:
t | The timeout in seconds. Use |
---|
poll(a:Array<Socket>, ?t:Float):Array<Socket>
Polls the given sockets for any events (e.g., readability or writability).
Parameters:
a | An array of sockets to monitor for events. |
---|---|
t | The timeout in seconds. Use |
Returns:
An array of sockets that are ready for I/O operations.