Base class for a generic XMPP stream.
Responsible for establishing connection, parsing the stream, handling
stream elements and passing stanzas receiver to other object.
This doesn't provide any authentication or encryption (both required by
the XMPP specification) and is not usable on its own.
Whenever we say "stream" here we actually mean two streams
(incoming and outgoing) of one connections, as defined by the XMPP
specification.
|
__init__(self,
stanza_namespace,
stanza_route,
handlers,
settings=None)
Initialize StreamBase object |
|
|
|
|
|
|
|
|
|
|
|
disconnect(self)
Gracefully close the connection. |
|
|
|
event(self,
event)
Handle a stream event. |
|
|
|
|
|
close(self)
Forcibly close the connection and clear the stream state. |
|
|
|
stream_start(self,
element)
Process <stream:stream> (stream start) tag received from peer. |
|
|
|
stream_end(self)
Process </stream:stream> (stream end) tag received from peer. |
|
|
|
|
|
stream_element(self,
element)
Process first level child element of the stream). |
|
|
|
|
|
_send_stream_start(self,
stream_id=None,
stream_to=None)
Send stream start tag. |
|
|
|
|
|
|
|
_restart_stream(self)
Restart the stream as needed after SASL and StartTLS negotiation. |
|
|
ElementTree.Element
|
|
|
|
|
|
|
|
|
send(self,
stanza)
Write stanza to the stream. |
|
|
|
_send(self,
stanza)
Same as send but assume lock is acquired. |
|
|
|
|
|
uplink_receive(self,
stanza)
Handle stanza received from the stream. |
|
|
|
|
|
check_to(self,
to)
Check "to" attribute of received stream header. |
|
|
|
generate_id(self)
Generate a random and unique stream ID. |
|
|
|
_got_features(self,
features)
Process incoming <stream:features/> element. |
|
|
|
is_connected(self)
Check if stream is is_connected and stanzas may be sent. |
|
|
|
|
|
|
|
fix_in_stanza(self,
stanza)
Fix incoming stanza, setting the implicit fields. |
|
|
|
fix_out_stanza(self,
stanza)
Fix outgoing, setting or clearing the implicit fields. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
dict
|
_element_handlers
mapping from stream element names to lists of
methods handling them
|
unicode
|
_input_state
None , "open" (<stream:stream> has been received)
"restart" or "closed" (</stream:stream> or EOF has been received)
|
unicode
|
_output_state
None , "open" (<stream:stream> has been received)
"restart" or "closed" (</stream:stream> or EOF has been received)
|
unicode
|
_stanza_namespace_p
qname prefix of the stanza namespace
|
list of StreamFeatureHandler
|
_stream_feature_handlers
stream features handlers
|
bool
|
authenticated
True if local entity has authenticated to peer
|
ElementTree.Element
|
features
stream features as annouced by the receiver.
|
list
|
handlers
handlers for stream elements
|
bool
|
initiator
True if local stream endpoint is the initiating entity.
|
threading.RLock
|
lock
RLock object used to synchronize access to Stream object.
|
JID
|
me
local stream endpoint JID.
|
JID
|
peer
remote stream endpoint JID.
|
bool
|
peer_authenticated
True if the peer has authenticated to us
|
unicode
|
peer_language
language of human-readable stream content selected
by the peer
|
XMPPSettings
|
settings
stream settings
|
unicode
|
stanza_namespace
default namespace of the stream
|
bool
|
tls_established
True when the stream is protected by TLS
|
transport.XMPPTransport
|
transport
transport used by this stream
|
(int , int ) tuple
|
version
Negotiated version of the XMPP protocol.
|