Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::SSL::SSLSocket#blocking
blocking(timeout = self.timeout) { || ... }
ext/openssl/lib/openssl/ssl.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/openssl/lib/openssl/ssl.rb, line 386
def blocking(timeout = self.timeout)
if timeout
remaining = timeout
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end
while true
ret = yield
if :wait_readable == ret
io.wait_readable(remaining) or raise IO_TimeoutError,
"Timed out while waiting to become readable!"
elsif :wait_writable == ret
io.wait_writable(remaining) or raise IO_TimeoutError,
"Timed out while waiting to become writable!"
else
return ret
end
if timeout
now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
remaining = [0, timeout - (now - start)].max
end
end
end
No documentation available