Class: Celluloid::IO::SSLSocket
- Extended by:
- Forwardable
- Defined in:
- lib/celluloid/io/ssl_socket.rb
Overview
SSLSocket with Celluloid::IO support
Constant Summary
Constants inherited from Socket
Celluloid::IO::Socket::Constants
Instance Attribute Summary
Attributes inherited from Stream
Instance Method Summary collapse
- #accept ⇒ Object
- #connect ⇒ Object
-
#initialize(io, ctx = OpenSSL::SSL::SSLContext.new) ⇒ SSLSocket
constructor
A new instance of SSLSocket.
Methods inherited from Stream
#<<, #close, #each, #each_byte, #eof?, #flush, #getc, #gets, #print, #printf, #puts, #read, #readchar, #readline, #readlines, #readpartial, #sysread, #syswrite, #ungetc, #wait_readable, #wait_writable, #write
Methods inherited from Socket
Constructor Details
#initialize(io, ctx = OpenSSL::SSL::SSLContext.new) ⇒ SSLSocket
Returns a new instance of SSLSocket.
20 21 22 23 24 25 |
# File 'lib/celluloid/io/ssl_socket.rb', line 20 def initialize(io, ctx = OpenSSL::SSL::SSLContext.new) @context = ctx socket = OpenSSL::SSL::SSLSocket.new(::IO.try_convert(io), @context) socket.sync_close = true if socket.respond_to?(:sync_close=) super(socket) end |
Instance Method Details
#accept ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/celluloid/io/ssl_socket.rb', line 35 def accept to_io.accept_nonblock self rescue ::IO::WaitReadable wait_readable retry rescue ::IO::WaitWritable wait_writable retry end |
#connect ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/celluloid/io/ssl_socket.rb', line 27 def connect to_io.connect_nonblock self rescue ::IO::WaitReadable wait_readable retry end |