Interface similar to Stdio.File.
Handles blocking and nonblocking mode.
Handles callback mode in an arbitrary backend (also in blocking mode).
Read and write operations might each do both reading and writing. In callback mode that means that installing either a read or a write callback might install both internally. It also means that reading in one thread while writing in another doesn't work.
Apart from the above, thread safety/atomicity characteristics are retained.
Blocking characterstics are retained for all functions.
destroy attempts to close the stream properly by sending the close packet, but since it can't do blocking I/O it's not certain that it will succeed. The stream should therefore always be closed with an explicit close call.
Abrupt remote close without the proper handshake gets the errno
Objects do not contain cyclic references, so they are closed and destructed timely when dropped.
- Variable next_protocol
The next protocol chosen by the client during next protocol negotiation.
- Method create
Create an SSL connection over an open stream.
Open socket or pipe to create the connection over.
The SSL context.
If is set then a client-side connection is started, server-side otherwise.
If is set then the stream is initially set in blocking mode, nonblocking mode otherwise.
The minimum minor version of SSL to support. Defaults to
The maximum minor version of SSL to support. Defaults to
Throws errors on handshake failure in blocking client mode.