Handles the initial listening socket. We can't seem to use EM.start_server -> EM.detach -> em.watch without triggering (in EventMachine 1.0.0):
Assertion failed: (sd != INVALID_SOCKET), function _RunSelectOnce, file em.cpp, line 893.
So we handle the server muckery ourselves.
# File lib/packetthief/handlers/ssl_server.rb, line 102 def notify_readable logdebug "(#{@ssl_class}): Received a new connection, spawning a #{@ssl_class}" sock = @servsocket.accept_nonblock ::EM.watch sock, @ssl_class, sock, *@args, @logger do |h| logdebug "after initialize" h.server_handler = self h.notify_readable = true h.logger = @logger # Now call the caller's block. @block.call(h) if @block # And finally finish initialization by applying the context to an # SSLSocket, and setting the internal state. h.tls_begin unless h.tcpsocket.closed? end end
# File lib/packetthief/handlers/ssl_server.rb, line 120 def notify_writable logdebug "(#{@ssl_class}): Server socket notify writable" end
Generated with the Darkfish Rdoc Generator 2.