Class: GReactor::SSLListenerIO

Inherits:
ListenerIO show all
Defined in:
lib/greactor/io_ssl_wrappers.rb

Overview

an SSL Listening IO wrapper.

Instance Attribute Summary

Attributes inherited from BasicIO

#cache, #io, #locker, #params, #timeout

Instance Method Summary collapse

Methods inherited from ListenerIO

#clear?, #initialize, #on_disconnect

Methods inherited from BasicIO

#[], #[]=, #clear?, #close, #closed?, #initialize, #on_disconnect, #read, #ssl?, #timeout?, #write

Constructor Details

This class inherits a constructor from GReactor::ListenerIO

Instance Method Details

#callObject


7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/greactor/io_ssl_wrappers.rb', line 7

def call
  s = nil
  begin
    @locker.synchronize { loop { s = @io.accept_nonblock(); GReactor.add_ssl_io s, @params.dup ; s = nil;} }
  rescue Errno::EWOULDBLOCK => e

  rescue OpenSSL::SSL::SSLError => e
    GReactor.warn "Due to an SSL issue, the connection was refused (maybe untrusted certificate)?"
  rescue => e
    GReactor.warn "#{e.message} - There are #{GReactor.count_ios} registered open IO objects."
  ensure
    (s.close if s && !s.closed? ) rescue true
  end
end