# File lib/network/acceptor.rb, line 35 def init # Open a socket for the server to listen on. @sock = TCPServer.new('0.0.0.0', @server.port) @sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true) @sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, false) unless RUBY_PLATFORM =~ /win32/ @sock.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK) end @accepting = true @server.register(self) true rescue Exception log.fatal $! false end