![](http://www.gnu-darwin.org/hexley-gd-sm.png)
|
# File jabber4r/session.rb, line 200
def initialize(host, port=5222)
@id = 1
@host = host
@port = port
@roster = Roster.new(self)
@messageListeners = Hash.new
@iqHandlers=Hash.new
@subscriptionHandler = nil
@connection = Jabber::Protocol::Connection.new(host, port)
@connection.connect
unless @connection.is_connected?
raise "Session Error: Could not connected to #{host}:#{port}"
else
@connection.send(Jabber::Protocol.gen_open_stream(host)) do |element|
if element.element_tag=="stream:stream"
element.consume_element
@session_id = element.attr_id
end
end
@connection.on_connection_exception do
if @session_failure_block
self.release
@session_failure_block.call
end
end
Thread.stop
end
end
|