123456789_123456789_123456789_123456789_123456789_

Class: OpenSSL::SSL::SSLServer

Relationships & Source Files
Inherits: Object
Defined in: lib/puma/accept_nonblock.rb

Instance Method Summary

Instance Method Details

#accept_nonblock

[ GitHub ]

  
# File 'lib/puma/accept_nonblock.rb', line 9

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 SSLError => ex
    if ssl
      ssl.close
    else
      sock.close
    end
    raise ex
  end
end