Class: PDTP::Client::Callbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/pdtp/client/callbacks.rb

Overview

Callbacks which can be overridden by clients to handle events

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Callbacks

:nodoc:



29
30
# File 'lib/pdtp/client/callbacks.rb', line 29

def initialize(*args) # :nodoc:
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



27
28
29
# File 'lib/pdtp/client/callbacks.rb', line 27

def client
  @client
end

Instance Method Details

#connected(client) ⇒ Object

Callback fired when a client has successfully connected to a server



33
34
# File 'lib/pdtp/client/callbacks.rb', line 33

def connected(client)
end

#disconnected(client) ⇒ Object

Callback fired when a client has been disconnected from a server Also fired if the connection attempt to a server fails



38
39
40
# File 'lib/pdtp/client/callbacks.rb', line 38

def disconnected(client)
  client.stop
end