Class: OpenSSL::SSL::SSLServer

Inherits:
Object
  • Object
show all
Defined in:
lib/raptor-io/ruby/openssl.rb

Instance Method Summary collapse

Instance Method Details

#accept_nonblockObject

Non-blocking version of accept, stolen directly from the blocking version, OpenSSL::SSL::SSLServer#accept.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/raptor-io/ruby/openssl.rb', line 8

def accept_nonblock
  sock = @svr.accept_nonblock

  begin
    ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
    ssl.sync_close = true
    ssl.accept if @start_immediately
    ssl
  rescue OpenSSL::SSL::SSLError => ex
    sock.close
    raise ex
  end
end