Native socket, using JNI + APR + openssl.
The socket is non-blocking - you can register either a blocking or non
There is no explicit method to register/unregister poll interest -
it is done automatically, when read/write methods return 0.
To keep the socket polling you must read all the available data, until
read() returns 0. If you want to pause - don't read all input. To resume -
read again until it returns 0.
Same for write - when write() returns 0 the socket is registered for
You can also use the blocking read/write methods.
Close input and output, potentially sending RST, than close the socket.
The proper way to close when gracefully done is by calling writeEnd() and
reading all remaining input until -1 (EOF) is received.
If EOF is received, the proper way to close is send whatever is remaining and