diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2019-03-31 15:06:25 +1300 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2019-03-31 15:06:25 +1300 |
commit | 95aa0ce9e9c1b95f8c92bb7963485ab2b0329ef0 (patch) | |
tree | 674aebccf9885879dd0b1a216bcb2e45e3a216a5 /lib | |
parent | 18ec883d6daaedbf32c66ca4ae6e41b66d0eeca4 (diff) | |
download | ruby-openssl-95aa0ce9e9c1b95f8c92bb7963485ab2b0329ef0.tar.gz |
Add `SSLSocket#fileno` and `SSLServer#fileno`. Fixes #198.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/openssl/ssl.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/openssl/ssl.rb b/lib/openssl/ssl.rb index 355eb2eb..ce826cbe 100644 --- a/lib/openssl/ssl.rb +++ b/lib/openssl/ssl.rb @@ -354,6 +354,11 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3 attr_reader :io alias :to_io :io + # The file descriptor for the socket. + def fileno + @io.fileno + end + # The SSLContext object used in this connection. attr_reader :context @@ -464,6 +469,11 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3 @svr end + # The file descriptor for the server socket. + def fileno + @svr.fileno + end + # See TCPServer#listen for details. def listen(backlog=5) @svr.listen(backlog) |