Method: Networking::TCPServer#initialize

Defined in:
lib/networking/tcp.rb

#initialize(port, obj_clb, new_clb = nil, closed_clb = nil, max_parallel = 1) ⇒ TCPServer

Returns a new instance of TCPServer.



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/networking/tcp.rb', line 61

def initialize(port, obj_clb, new_clb=nil, closed_clb=nil, max_parallel=1)
  @port = port
  @obj_clb = obj_clb
  @new_clb = new_clb
  @closed_clb = closed_clb
  # Max parallel connections is not implemented yet.
  @max_parallel = max_parallel
  @sockets = {}
  @tcp_thread = run_server
  @tcp_thread.abort_on_exception = true
end