Class: QueryServer

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/query_server.rb

Overview

QueryServer responds to telnet-calls on its designated port, and responds with thingsā€¦

Instance Method Summary collapse

Instance Method Details

#post_initObject



4
5
6
7
8
# File 'lib/query_server.rb', line 4

def post_init
  send_data "#{$clients.length} clients connected"
  
  
end

#receive_data(data) ⇒ Object



10
11
12
13
# File 'lib/query_server.rb', line 10

def receive_data(data)
  send_data "#{$clients.length} clients connected"
  close_connection if data =~ /quit/i
end