SSL_GET_RPOLL_DESCRIPTOR(3ossl)
π SSL_GET_RPOLL_DESCRIPTOR π
okay bestie so you're in 3ossl land and you wanna know when your QUIC connection is actually ready to do network stuff instead of just spinning your event loop for no reason?? say less. this page is literally the glow-up guide for SSL_get_rpoll_descriptor, SSL_get_wpoll_descriptor, SSL_net_read_desired and SSL_net_write_desired β the four functions that tell you when network I/O can be performed. no cap.
β¨ NAME β¨
SSL_get_rpoll_descriptor, SSL_get_wpoll_descriptor, SSL_net_read_desired, SSL_net_write_desired β 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);
like. that's it. four little guys. π«Ά
π DESCRIPTION π
so SSL_get_rpoll_descriptor() and SSL_get_wpoll_descriptor() are the ones you call when you've got an SSL object representing a QUIC connection and you need to know when it can do useful network I/O. translation: if your app is using a QUIC connection SSL object in nonblocking mode, these tell you when you should be calling SSL_handle_events() instead of just sitting there guessing. π
On success, these functions output poll descriptors. For more info on what a poll descriptor even is, go read BIO_get_rpoll_descriptor(3) β she explains it better than I ever could.
Then we've got SSL_net_read_desired() and SSL_net_write_desired(), which 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. so:
- if an
SSLobject is not interested in reading data from the network right now,SSL_net_read_desired()returns0 - if an
SSLobject is not interested in writing data to the network right now,SSL_net_write_desired()returns0
main character energy is knowing when to chill and when to move. β¨
The intention β and yes, the manpage says "intention", so we're being intentional β 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. And when such a condition arises, SSL_handle_events(3) should be called. periodt.
In particular, the expected usage is as follows:
SSL_handle_events()should be called whenever the timeout returned bySSL_get_event_timeout(3)(if any) expires β°- If the last call to
SSL_net_read_desired()returned1,SSL_handle_events()should be called whenever the poll descriptor output bySSL_get_rpoll_descriptor()becomes readable. - If the last call to
SSL_net_write_desired()returned1,SSL_handle_events()should be called whenever the poll descriptor output bySSL_get_wpoll_descriptor()becomes writable.
β οΈ heads up bestie, the return values ofSSL_net_read_desired()andSSL_net_write_desired()may change in response to any call to theSSLobject β except forSSL_net_read_desired(),SSL_net_write_desired(),SSL_get_rpoll_descriptor(),SSL_get_wpoll_descriptor()andSSL_get_event_timeout(). those five are the safe ones. everything else can flip the vibe.
Now, if you're on a non-QUIC SSL object (iykyk, the classic), things get even simpler:
- calls to
SSL_get_rpoll_descriptor()andSSL_get_wpoll_descriptor()function the same as calls toBIO_get_rpoll_descriptor()andBIO_get_wpoll_descriptor()on the respective read and write BIOs configured on theSSLobject π - calls to
SSL_net_read_desired()andSSL_net_write_desired()function identically to calls toSSL_want_read()andSSL_want_write()respectively π
π RETURN VALUES π
These functions return 1 on success and 0 on failure. that's the whole thing. iconic, honestly.
π SEE ALSO π
SSL_handle_events(3), SSL_get_event_timeout(3), ssl(7)
go read those too, bestie, they're all part of the same friend group π§
β 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. so if you're on anything older, sorry babe, they don't exist yet π
π COPYRIGHT π
Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, slay π
this was OpenSSL version 3.5.9, dated 2026-09-29 β mwah, go forth and poll responsibly π¦β¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms