SSL_get_rpoll_descriptor.3ossl - Man Page

obtain information which can be used to determine when network I/O can be performed

Synopsis

 #include <openssl/ssl.h>

 int SSL_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc);
 int SSL_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc);
 int SSL_net_read_desired(SSL *s);
 int SSL_net_write_desired(SSL *s);

Description

The functions SSL_get_rpoll_descriptor() and SSL_get_wpoll_descriptor() can be used to determine when an SSL object which represents a QUIC connection can perform useful network I/O, so that an application using a QUIC connection SSL object in nonblocking mode can determine when it should call SSL_handle_events().

On success, these functions output poll descriptors. For more information on poll descriptors, see BIO_get_rpoll_descriptor(3).

The functions SSL_net_read_desired() and SSL_net_write_desired() return 1 or 0 depending on whether the SSL object is currently interested in receiving data from the network and/or writing data to the network respectively. If an SSL object is not interested in reading data from the network at the current time, SSL_net_read_desired() will return 0; likewise, if an SSL object is not interested in writing data to the network at the current time, SSL_net_write_desired() will return 0.

The intention is that an application using QUIC in nonblocking mode can use these calls, in conjunction with SSL_get_event_timeout(3) to wait for network I/O conditions which allow the SSL object to perform useful work. When such a condition arises, SSL_handle_events(3) should be called.

In particular, the expected usage is as follows:

The return values of the SSL_net_read_desired() and SSL_net_write_desired() functions may change in response to any call to the SSL object other than SSL_net_read_desired(), SSL_net_write_desired(), SSL_get_rpoll_descriptor(), SSL_get_wpoll_descriptor() and SSL_get_event_timeout().

On non-QUIC SSL objects, calls to SSL_get_rpoll_descriptor() and SSL_get_wpoll_descriptor() function the same as calls to BIO_get_rpoll_descriptor() and BIO_get_wpoll_descriptor() on the respective read and write BIOs configured on the SSL object.

On non-QUIC SSL objects, calls to SSL_net_read_desired() and SSL_net_write_desired() function identically to calls to SSL_want_read() and SSL_want_write() respectively.

Return Values

These functions return 1 on success and 0 on failure.

See Also

SSL_handle_events(3), SSL_get_event_timeout(3), ssl(7)

History

The SSL_get_rpoll_descriptor(), SSL_get_wpoll_descriptor(), SSL_net_read_desired() and SSL_net_write_desired() functions were added in OpenSSL 3.2.

Referenced By

BIO_get_rpoll_descriptor.3ossl(3), openssl-quic.7ossl(7).

The man pages SSL_get_wpoll_descriptor.3ossl(3), SSL_net_read_desired.3ossl(3) and SSL_net_write_desired.3ossl(3) are aliases of SSL_get_rpoll_descriptor.3ossl(3).

2024-09-12 3.2.2 OpenSSL