Class: Sponges::Listener

Inherits:
Object
  • Object
show all
Defined in:
lib/sponges/listener.rb

Constant Summary collapse

CRLF =
"\r\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(supervisor) ⇒ Listener

Returns a new instance of Listener.



7
8
9
# File 'lib/sponges/listener.rb', line 7

def initialize(supervisor)
  @supervisor = supervisor
end

Instance Attribute Details

#supervisorObject (readonly)

Returns the value of attribute supervisor.



4
5
6
# File 'lib/sponges/listener.rb', line 4

def supervisor
  @supervisor
end

Instance Method Details

#callObject



11
12
13
# File 'lib/sponges/listener.rb', line 11

def call
  Socket.tcp_server_loop("0.0.0.0", port) {|c| handle_connection c }
end