Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

OpenSSL::SSL::SSLSocket#pending

() -> ::Integer
ssl.pending => Integer

Returns the number of bytes buffered by the OpenSSL library and immediately available for reading with sysread.

This does not include data read ahead and buffered by SSLSocket. It may therefore return 0 even when data is available for reading with methods that are aware of the SSLSocket buffer, such as read or gets.

See also the man page SSL_pending(3).