Class: FluQ::Input::Socket
Defined Under Namespace
Classes: Connection
Instance Attribute Summary collapse
- #url ⇒ Object readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ Socket
constructor
Constructor.
-
#name ⇒ String
Descriptive name.
-
#run ⇒ Object
Start the server.
Methods inherited from Base
Methods included from Mixins::Loggable
Constructor Details
Instance Attribute Details
#url ⇒ Object (readonly)
4 5 6 |
# File 'lib/fluq/input/socket.rb', line 4 def url @url end |
Instance Method Details
#name ⇒ String
Returns descriptive name.
22 23 24 |
# File 'lib/fluq/input/socket.rb', line 22 def name @name ||= "#{super} (#{@url})" end |
#run ⇒ Object
Start the server
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/fluq/input/socket.rb', line 27 def run args = [self.class::Connection, self] case @url.scheme when 'tcp' EventMachine.start_server @url.host, @url.port, *args when 'udp' EventMachine.open_datagram_socket @url.host, @url.port, *args when 'unix' EventMachine.start_server @url.path, *args end end |