Class: AgentXmpp::Client
Overview
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
———————————————————————————————————.
Instance Method Summary collapse
-
#add_delegate(delegate) ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
-
#close_connection ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
-
#connect ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
-
#initialize ⇒ Client
constructor
.….….….….….….….….….….….….….….….….….….….….….….….….….….
-
#pipe ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
-
#reconnect ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
-
#remove_delegate(delegate) ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
Constructor Details
#initialize ⇒ Client
.….….….….….….….….….….….….….….….….….….….….….….….….….….
18 19 |
# File 'lib/agent_xmpp/client/client.rb', line 18 def initialize end |
Instance Attribute Details
#connection ⇒ Object (readonly)
14 15 16 |
# File 'lib/agent_xmpp/client/client.rb', line 14 def connection @connection end |
Instance Method Details
#add_delegate(delegate) ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
51 52 53 |
# File 'lib/agent_xmpp/client/client.rb', line 51 def add_delegate(delegate) connection.pipe.add_delegate(delegate) end |
#close_connection ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
34 35 36 37 |
# File 'lib/agent_xmpp/client/client.rb', line 34 def close_connection AgentXmpp.logger.info "CLOSE CONNECTION" connection.close_connection_after_writing unless connection.nil? end |
#connect ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/agent_xmpp/client/client.rb', line 22 def connect while (true) EventMachine.run do @connection = EventMachine.connect(AgentXmpp.jid.domain, AgentXmpp.port, Connection, self) end Boot.call_if_implemented(:call_restarting_client, pipe) sleep(10.0) AgentXmpp.logger.warn "RESTARTING CLIENT" end end |
#pipe ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….….….
46 47 48 |
# File 'lib/agent_xmpp/client/client.rb', line 46 def pipe connection.pipe end |