Portability Libraries  2015.2.0.0
Common Methods and Objects for Platform Independance.
Synchronous and Asynchronous I/O

The Poll object wraps poll(2) with asynchronous I/O. It allows the caller to name buffers, ask buffers to be created to buffer I/O. This works with file and socket handles on all OS's.

You can add a file handle to the list, setup a buffer to write, then call the poll method. This library takes care of emptying the buffer as fast as the socket can handle. A callback will be called when the buffer is written or the remote end closes the socket.

You can add a file handle to the list, provide or have the library create a buffer to read into, and ask to be notified when the buffer is full or no more can be read. A callback is called.

You MUST setup the callback handlers before performing any I/O. You will not get the notifications and may miss data if there are not callback handlers. As soon as a callback handler is setup or changed, it takes effect the next time it triggers its associated event.

The "WakUpReady()" method (Windows) breaks poll(2) out of its loop so this implementation can update its list of actions.