x::fd
is a subclass of a generic file
descriptor transport interface.
x::fdbase
is a reference to a reference-counted object that defines an abstract
interface for a subset of file descriptor methods:
pubread
(),
pubwrite
(),
pubseek
(),
pubaccept
(),
pubconnect
() and
pubclose
()
are the equivalent to their
non-"pub" versions, except that they are virtual.
x::fd
implements
read(), write(), seek() and connect() as inline functions
that are suitable for compile-time optimizations, and
implements the pub methods by invoking the non-pub functions.
accept() is not inlined, but it's inherited from
x::fdbase
.
pubread_pending() returns the number of unread bytes that are waiting to be read. If the next call to pubread() specifies not more than the returned number of bytes, pubread() is guaranteed to return immediately, without blocking.
The implementation in x::fd
always
returns 0. The TLS session object
passes through this method to the underlying library. An encrypted
bytestream gets transferred in large blocks, which are then doled
out, piecemeal, by pubread(), so at a given time there may be
additional data that's available to be read.
getistream(), getostream() and getiostream() return a reference-counted stream object.
get_fd() returns the underlying open file descriptor.