BIO_get_rpoll_descriptor() and BIO_get_wpoll_descriptor(), on success, fill *desc with a poll descriptor.
A poll descriptor is a tagged union structure which represents some kind of OS or non-OS resource which
can be used to synchronise on I/O availability events.
BIO_get_rpoll_descriptor() outputs a descriptor which can be used to determine when the BIO can
(potentially) next be read, and BIO_get_wpoll_descriptor() outputs a descriptor which can be used to
determine when the BIO can (potentially) next be written.
It is permissible for BIO_get_rpoll_descriptor() and BIO_get_wpoll_descriptor() to output the same
descriptor.
Poll descriptors can represent different kinds of information. A typical kind of resource which might be
represented by a poll descriptor is an OS file descriptor which can be used with APIs such as select().
The kinds of poll descriptor defined by OpenSSL are:
BIO_POLL_DESCRIPTOR_TYPE_NONE
Represents the absence of a valid poll descriptor. It may be used by BIO_get_rpoll_descriptor() or
BIO_get_wpoll_descriptor() to indicate that the BIO is not pollable for readability or writeability
respectively.
For this type, no field within the value field of the BIO_POLL_DESCRIPTOR is valid.
BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD
The poll descriptor represents an OS socket resource. The field value.fd in the BIO_POLL_DESCRIPTOR
is valid if it is not set to -1.
The resource is whatever kind of handle is used by a given OS to represent sockets, which may vary by
OS. For example, on Windows, the value is a SOCKET for use with the Winsock API. On POSIX-like
platforms, it is a file descriptor.
Where a poll descriptor of this type is output by BIO_get_rpoll_descriptor(), it should be polled for
readability to determine when the BIO might next be able to successfully complete a BIO_read()
operation; likewise, where a poll descriptor of this type is output by BIO_get_wpoll_descriptor(), it
should be polled for writeability to determine when the BIO might next be able to successfully
complete a BIO_write() operation.
BIO_POLL_DESCRIPTOR_CUSTOM_START
Type values beginning with this value (inclusive) are reserved for application allocation for custom
poll descriptor types. Any of the definitions in the union field value can be used by the application
arbitrarily as opaque values.
Because poll descriptors are a tagged union structure, they can represent different kinds of information.
New types of poll descriptor may be defined, including by applications, according to their needs.