Class: Quark::Server::TcpServer

Inherits:
BaseServer show all
Defined in:
lib/quark/servers/tcp.rb

Instance Method Summary collapse

Methods inherited from BaseServer

start, to_s

Constructor Details

#initialize(options = nil) ⇒ TcpServer

Returns a new instance of TcpServer.



7
8
9
# File 'lib/quark/servers/tcp.rb', line 7

def initialize(options=nil)
  @_options = options || Quark::Config.get("quark.tcp",{})
end

Instance Method Details

#runObject



11
12
13
14
# File 'lib/quark/servers/tcp.rb', line 11

def run()
  puts "Starting #{self.class.to_s} server on #{@_options.get(:address)}:#{@_options.get(:port)}..."
  EM::start_server(@_options.get(:address, '127.0.0.1'), @_options.get(:port, 12161).to_i, Quark::CommandProcessor)
end