Class: Sponges::Listener
- Inherits:
-
Object
- Object
- Sponges::Listener
- Defined in:
- lib/sponges/listener.rb
Constant Summary collapse
- CRLF =
"\r\n"
Instance Attribute Summary collapse
-
#supervisor ⇒ Object
readonly
Returns the value of attribute supervisor.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(supervisor) ⇒ Listener
constructor
A new instance of Listener.
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
#supervisor ⇒ Object (readonly)
Returns the value of attribute supervisor.
4 5 6 |
# File 'lib/sponges/listener.rb', line 4 def supervisor @supervisor end |
Instance Method Details
#call ⇒ Object
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 |