lib/forwardmachine/forwarder.rb
# Public: Start forwarding server on given host and port taken from PortsPool.
# Returns: Socket address of the server in format "host:port" as String
Start forwarding server on given host and port taken from PortsPool.
Returns: Socket address of the server in format "host:port" as String
Start forwarding server on given host and port taken from PortsPool . Returns : Socket address of the server in format " host : port " as String
def start
      @server = EM.start_server(host, port, ForwarderConnection, destination, self) do
        @connections += 1
        @inactivity_timer.cancel
      end
      @inactivity_timer = EM::PeriodicTimer.new(FIRST_USE_TIMEOUT) do
        logger.info("Forwarder #{self} timed out after #{FIRST_USE_TIMEOUT} seconds")
        stop
      end
      logger.info("Started forwarder #{self}")
      socket_address
    end
def start @server = EM . start_server ( host , port , ForwarderConnection , destination , self ) do @connections += 1 @inactivity_timer . cancel end @inactivity_timer = EM :: PeriodicTimer . new ( FIRST_USE_TIMEOUT ) do logger . info ( "Forwarder #{self} timed out after #{FIRST_USE_TIMEOUT} seconds" ) stop end logger . info ( "Started forwarder #{self}" ) socket_address end
Public: Start forwarding server on given host and port taken from PortsPool.
Public : Start forwarding server on given host and port taken from PortsPool .