The XMPP stream handling in headstock is performed by the Stream module. This should be considered a private module instanciated by the main client class.
A client stream is the interface between a remote XMPP service and the client. It handles the connection and authentication.
jid headstock.protocol.core.jid.JID instance
password account’s password
tls False - flag indicating if the stream runs over a TLS connection
register False - flag indicating if the registration was requested.
Authentication successful
Raises a headstock.error.HeadstockAuthenticationSuccess instance handled by the client.
XMPP handler whenever a stream error is returned.
Raises a headstock.error.HeadstockStreamError instance which will be trapped by the client.
XMPP handler for stream features.
It will:
of view) if self.tls is True and the feature has a `<starttls /> child. * initiates the authentication based on the supported mechanisms or abort if none is found.
Handles the session elements received by the server.
If the type of the response is result it raises headstock.error.HeadstockAuthenticationSuccess instance handled by the client indicating the session is ready.
Otherwise returns the session stanza indicating the client wishes to start a session.
TLS negociation was successful.
Raises a headstock.error.HeadstockStartTLS instance handled by the client.