|
NAMEProtocol::XMPP::Stream - handle XMPP protocol streamVERSIONVersion 0.006SYNOPSISDESCRIPTIONMETHODSnewInstantiate a stream object. Used for interacting with the underlying XMPP stream.Takes the following parameters as callbacks:
and the following scalar parameters:
on_dataData has been received, pass it over to the SAX parser to trigger any required events.queue_writeQueue 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. write_bufferReturns the contents of the current write buffer without changing it.extract_writeRetrieves next pending message from the write buffer and removes it from the list.ready_to_sendReturns true if there's data ready to be written.resetReset 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 "<stream"> element, for example after authentication or TLS upgrade. dispatch_eventCall the appropriate event handler.Currently defined events:
preambleReturns the XML header and opening stream preamble.jidReturns 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. userUsername for SASL authentication.passPassword for SASL authentication.hostnameName of the hostresourceFragment used to differentiate this client from any other active clients for this user (as defined by bare JID).write_xmlWrite a chunk of XML to the stream, converting from the internal representation to XML text stanzas.write_textWrite raw text to the output stream.loginProcess the login.Takes optional named parameters:
is_authorisedReturns true if we are authorised already.is_loggedinReturns true if we are logged in already.streamOverride the ->stream method from the base class so that we pick up our own methods directly.next_idReturns the next ID in the sequence for outgoing requests.on_tls_completeContinues the next part of the connection when TLS is complete.composeCompose a new outgoing message.subscribeSubscribe to a new contact. Takes a single JID as target.unsubscribeUnsubscribe from the given contact. Takes a single JID as target.authoriseGrant authorisation to the given contact. Takes a single JID as target.deauthoriseRevokes auth for the given contact. Takes a single JID as target.AUTHORTom Molesworth <cpan@entitymodel.com>LICENSECopyright Tom Molesworth 2010-2014. Licensed under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |