instance method
OpenSSL::SSL::SSLSocket#accept_nonblock
(?exception: true) -> self
(exception: false) -> (self | :wait_readable | :wait_writable)
ssl.accept_nonblock([options]) => self
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_ssl_accept_nonblock(int argc, VALUE *argv, VALUE self)
{
VALUE opts;
rb_scan_args(argc, argv, "0:", &opts);
ossl_ssl_setup(self);
return ossl_start_ssl(self, SSL_accept, "SSL_accept", opts);
}
Initiates the SSL/TLS handshake as a server in non-blocking manner.
Example
# emulates blocking accept begin ssl.accept_nonblock rescue IO::WaitReadable IO.select([s2]) retry rescue IO::WaitWritable IO.select(nil, [s2]) retry end
By specifying a keyword argument exception to false, you can indicate that accept_nonblock should not raise an IO::WaitReadable or IO::WaitWritable exception, but return the symbol :wait_readable or :wait_writable instead.