XML stream.

Google

Class
Jabber::Protocol::Connection
In: jabber4r/protocol.rb
Parent: Object

The connection class encapsulates the connection to the Jabber service including managing the socket and controlling the parsing of the Jabber

Methods

Attributes

 [R]  :host
 [R]  :input
 [R]  :output
 [R]  :port
 [R]  :status
Public Class methods
new(host, port=5222) src
Public Instance methods
connect() src

Connects to the Jabber server through a TCP Socket and starts the Jabber parser.

on_connection_exception(&block) src

Mounts a block to handle exceptions if they occur during the poll send. This will likely be the first indication that the socket dropped in a Jabber Session.

parse_failure() src
is_connected?() src

Returns if this connection is connected to a Jabber service

return:[Boolean] Connection status
is_disconnected?() src

Returns if this connection is NOT connected to a Jabber service

return:[Boolean] Connection status
receive(element) src

Processes a received ParsedXMLElement and executes registered thread blocks and filters against it.

element:[ParsedXMLElement] The received element
src

Sends XML data to the socket and (optionally) waits to process received data.

proc:[Proc = nil] The optional proc
&block:[Block] The optional block
poll() src

Starts a polling thread to send "keep alive" data to prevent the Jabber connection from closing for inactivity.

add_filter(ref, proc=nil, &block) src

Adds a filter block/proc to process received XML messages

proc:[Proc = nil] The optional proc
&block:[Block] The optional block
delete_filter(ref) src
close() src

Closes the connection to the Jabber service