class Kraken::Listener

This class receives the TCP connections.

Public Class Methods

new() click to toggle source
# File lib/kraken/core/listener.rb, line 7
def initialize
  @manager = TCPServer.new 3030
  @thread = Thread.new { start }
end

Public Instance Methods

close() click to toggle source
# File lib/kraken/core/listener.rb, line 19
def close
  @thread.kill
  @manager.close
end
join() click to toggle source
# File lib/kraken/core/listener.rb, line 24
def join
  @thread.join
end
start() click to toggle source
# File lib/kraken/core/listener.rb, line 12
def start
  loop do
    Kraken::HandlerFactory.create(@manager.accept)
    Kraken::Log.info 'wild socket appeared!'
  end
end