Class: Alo7::Net::Server

Inherits:
Connection show all
Defined in:
lib/alo7/net/server.rb

Overview

This is a class that provides the server logics.

Class Method Summary collapse

Methods inherited from Connection

#await, #disconnect, #initialize, #send_data

Methods included from Connection::Callbacks

#connection_completed, #post_init, #receive_data, #unbind

Constructor Details

This class inherits a constructor from Alo7::Net::Connection

Class Method Details

.listen(host, port) ⇒ Integer .listen(port) ⇒ Integer

Initiate a TCP server on the specified IP address and port.

Overloads:

  • .listen(host, port) ⇒ Integer

    Parameters:

    • host (String)

      host to listen on

    • port (Integer)

      port to listen on

    • *args

      passed to the initializer of the server

  • .listen(port) ⇒ Integer

    Parameters:

    • port (Integer)

      port to listen on

    • *args

      passed to the initializer of the server

Yields:

  • (connection)

    initiated when a connection is made

Returns:

  • (Integer)

    the internal signature

Raises:

  • (ArgumentError)

    if the handler doesn't have a innerclass named Impl


21
22
23
# File 'lib/alo7/net/server.rb', line 21

def self.listen(host_or_port, port = nil, *args, &block)
  Net.listen self, host_or_port, port, *args, &block
end