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.

Yields:

  • (connection)

    initiated when a connection is made

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