Base class for a generic XMPP stream.
Responsible for establishing connection, parsing the stream, dispatching
received stanzas to apopriate handlers and sending application's stanzas.
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,
default_ns,
extra_ns=( ) ,
keepalive=0,
owner=None)
Initialize Stream object |
source code
|
|
|
_reset(self)
Reset Stream object state making it ready to handle new
connections. |
source code
|
|
|
|
|
|
|
connect(self,
addr,
port,
service=None,
to=None)
Establish XMPP connection with given address. |
source code
|
|
|
_connect(self,
addr,
port,
service=None,
to=None)
Same as Stream.connect but assume self.lock is acquired. |
source code
|
|
|
|
|
|
|
disconnect(self)
Gracefully close the connection. |
source code
|
|
|
|
|
|
|
|
|
|
|
close(self)
Forcibly close the connection and clear the stream state. |
source code
|
|
|
|
|
|
|
|
|
|
|
stanza_start(self,
doc,
node)
Process stanza (first level child element of the stream) start tag
-- do nothing. |
source code
|
|
|
stanza(self,
_unused,
node)
Process stanza (first level child element of the stream). |
source code
|
|
|
|
|
_send_stream_end(self)
Send stream end tag. |
source code
|
|
|
_send_stream_start(self,
sid=None)
Send stream start tag. |
source code
|
|
|
|
|
_restart_stream(self)
Restart the stream as needed after SASL and StartTLS negotiation. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
idle(self)
Do some housekeeping (cache expiration, timeout handling). |
source code
|
|
|
|
|
fileno(self)
Return filedescriptor of the stream socket. |
source code
|
|
|
loop(self,
timeout)
Simple "main loop" for the stream. |
source code
|
|
|
loop_iter(self,
timeout)
Single iteration of a simple "main loop" for the stream. |
source code
|
|
|
|
|
|
|
|
|
_read(self)
Read data pending on the stream socket and pass it to the parser. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from stanzaprocessor.StanzaProcessor :
fix_in_stanza ,
fix_out_stanza ,
process_iq ,
process_message ,
process_presence ,
process_response ,
process_stanza ,
route_stanza ,
set_iq_get_handler ,
set_iq_set_handler ,
set_message_handler ,
set_presence_handler ,
set_response_handlers ,
unset_iq_get_handler ,
unset_iq_set_handler
Inherited from xmlextra.StreamHandler :
warning
|