Module: Adhearsion::XMPP::Connection

Defined in:
lib/adhearsion/xmpp/connection.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clientObject

Returns the value of attribute client.



9
10
11
# File 'lib/adhearsion/xmpp/connection.rb', line 9

def client
  @client
end

Class Method Details

.start(jid, password, server, port) ⇒ Object

Open the XMPP connection

Parameters:

  • jid (String)

    the client/component JID to connect to

  • password (String)
  • server (String)
  • port (Integer)


18
19
20
21
22
23
24
25
26
# File 'lib/adhearsion/xmpp/connection.rb', line 18

def start(jid, password, server, port)
  Blather.logger = logger
  setup_client_object jid, password, server, port
  register_event_namespaces
  register_default_client_handlers
  Adhearsion::Events.register_callback(:after_initialized) do
    connect
  end
end

.stopObject

Close the XMPP connection



29
30
31
# File 'lib/adhearsion/xmpp/connection.rb', line 29

def stop
  shutdown
end