Class: Sappho::Heatmiser::Proxy::CommandLine

Inherits:
Object
  • Object
show all
Defined in:
lib/sappho-heatmiser-proxy.rb

Class Method Summary collapse

Class Method Details

.processObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/sappho-heatmiser-proxy.rb', line 19

def CommandLine.process
  Sappho::ApplicationAutoFlushLog.instance.info "#{NAME} version #{VERSION} - #{HOMEPAGE}"
  port = SystemConfiguration.instance.heatmiserPort
  maxClients = SystemConfiguration.instance.maxClients
  server = Sappho::Socket::SafeServer.new('heatmiser proxy', port, maxClients, 10, true)
  server.serve do
    | socket, ip | HeatmiserClient.new(socket, ip).communicate
  end
  Thread.new do
    Heatmiser.new.monitor do
      server.clientCount > 0
    end
  end.join
end