Protocol::XMPP::Stream - handle XMPP protocol stream
Instantiate a stream object. Used for interacting with the underlying XMPP stream.
Takes the following parameters as callbacks:
and the following scalar parameters:
Data has been received, pass it over to the SAX parser to trigger any required events.
Queue up a write for this stream. Adds to the existing send buffer array if there is one.
When a write is queued, this will send a notification to the on_queued_write callback if one was defined.
Returns the contents of the current write buffer without changing it.
Retrieves next pending message from the write buffer and removes it from the list.
Returns true if there's data ready to be written.
Reset this stream.
Clears out the existing SAX parsing information and sets up a new Protocol::XMPP::Handler ready to accept events.
Used when we expect a new
for example after authentication or TLS upgrade.
Call the appropriate event handler.
Currently defined events:
Returns the XML header and opening stream preamble.
Returns the full JID for our user.
If given a parameter, will set the JID to that value, extracting hostname and user by splitting the domain.
Username for SASL authentication.
Password for SASL authentication.
Name of the host
Fragment used to differentiate this client from any other active clients for this user (as defined by bare JID).
Write a chunk of XML to the stream, converting from the internal representation to XML text stanzas.
Write raw text to the output stream.
Process the login.
Takes optional named parameters:
Returns true if we are authorised already.
Returns true if we are logged in already.
Override the ->stream method from the base class so that we pick up our own methods directly.
Returns the next ID in the sequence for outgoing requests.
Continues the next part of the connection when TLS is complete.
Compose a new outgoing message.
Subscribe to a new contact. Takes a single JID as target.
Unsubscribe from the given contact. Takes a single JID as target.
Grant authorisation to the given contact. Takes a single JID as target.
Revokes auth for the given contact. Takes a single JID as target.
Tom Molesworth <email@example.com>
Copyright Tom Molesworth 2010-2014. Licensed under the same terms as Perl itself.