Class: LightIO::Library::OpenSSL::SSL::SSLSocket

Inherits:
Object
  • Object
show all
Includes:
Base, IO::IOMethods, Wrap::IOWrapper
Defined in:
lib/lightio/library/openssl.rb

Instance Method Summary collapse

Methods included from Wrap::IOWrapper

included

Methods included from Base

included

Methods included from IO::IOMethods

#close, #eof, #flush, #getbyte, #getc, #gets, #lightio_initialize, #print, #printf, #puts, #read, #readbyte, #readchar, #readline, #readlines, #readpartial, #wait, #wait_readable, #wait_writable, #write

Constructor Details

#initialize(io, *args) ⇒ SSLSocket

Returns a new instance of SSLSocket.



14
15
16
17
18
19
20
# File 'lib/lightio/library/openssl.rb', line 14

def initialize(io, *args)
  if io.is_a?(LightIO::Library::IO)
    @_wrapped_socket = io
    io = io.send(:light_io_raw_obj)
  end
  super(io, *args)
end

Instance Method Details

#accept_nonblockObject



22
23
24
25
# File 'lib/lightio/library/openssl.rb', line 22

def accept_nonblock
  socket = @obj.accept_nonblock(*args)
  socket.is_a?(Symbol) ? socket : self.class._wrap(socket)
end

#to_ioObject Also known as: io



27
28
29
# File 'lib/lightio/library/openssl.rb', line 27

def to_io
  @_wrapped_socket || @obj.io
end