Class: Plum::Rack::TCPListener

Inherits:
BaseListener show all
Defined in:
lib/plum/rack/listener.rb

Instance Method Summary collapse

Methods inherited from BaseListener

#method_missing, #stop

Constructor Details

#initialize(lc) ⇒ TCPListener

Returns a new instance of TCPListener.



19
20
21
# File 'lib/plum/rack/listener.rb', line 19

def initialize(lc)
  @server = ::TCPServer.new(lc[:hostname], lc[:port])
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Plum::Rack::BaseListener

Instance Method Details

#plum(sock) ⇒ Object



27
28
29
# File 'lib/plum/rack/listener.rb', line 27

def plum(sock)
  ::Plum::HTTPServerConnection.new(sock)
end

#to_ioObject



23
24
25
# File 'lib/plum/rack/listener.rb', line 23

def to_io
  @server.to_io
end