Class: Clients::ConnectionEvents

Inherits:
P2::Connection
  • Object
show all
Defined in:
lib/clients/order_console.rb

Overview

Event processing classes

Instance Method Summary collapse

Constructor Details

#initialize(app_name) ⇒ ConnectionEvents

Returns a new instance of ConnectionEvents.



11
12
13
14
15
16
17
# File 'lib/clients/order_console.rb', line 11

def initialize app_name
  # Create Connection object
  super :ini => CLIENT_INI, :app_name => app_name,
        :host => "127.0.0.1", :port => 4001
  self.events.handler = self
  self.Connect()
end

Instance Method Details

#onConnectionStatusChanged(conn, new_status) ⇒ Object

Define Handler for IP2ConnectionEvent event interface



20
21
22
# File 'lib/clients/order_console.rb', line 20

def onConnectionStatusChanged(conn, new_status)
  $log.puts "EVENT ConnectionStatusChanged: #{conn} - #{status_text new_status}"
end