pyxmpp2.clientstream.ClientStream

Package pyxmpp2 :: Module clientstream :: Class ClientStream |
[hide private]

# Class ClientStream

Handles XMPP-IM c2s stream.

Both client and server side of the connection is supported. This class handles client SASL authentication, authorisation and resource binding.

Nested Classes | [hide private]
Inherited from `mainloop.interfaces.TimeoutHandler`: `__metaclass__`

Instance Methods | [hide private]
__init__(self, jid, handlers, settings=None) Initialize the ClientStream object. |
initiate(self, transport, to=None) Initiate an XMPP connection over the transport. |
receive(self, transport, myname=None) Receive an XMPP connection over the transport. |
fix_out_stanza(self, stanza) Fix outgoing stanza. |
fix_in_stanza(self, stanza) Fix an incoming stanza. |
Inherited from `streambase.StreamBase`: `check_to`, `close`, `disconnect`, `event`, `generate_id`, `is_connected`, `process_stream_error`, `regular_tasks`, `send`, `send_stream_error`, `set_authenticated`, `set_peer_authenticated`, `stream_element`, `stream_end`, `stream_eof`, `stream_parse_error`, `stream_start`, `transport_connected`, `write_element` Inherited from `streambase.StreamBase` (private): `_got_features`, `_initiate`, `_make_stream_features`, `_process_element`, `_restart_stream`, `_send`, `_send_stream_error`, `_send_stream_features`, `_send_stream_start`, `_setup_stream_element_handlers`, `_write_element` Inherited from `stanzaprocessor.StanzaProcessor`: `process_iq`, `process_message`, `process_presence`, `process_stanza`, `route_stanza`, `set_response_handlers`, `setup_stanza_handlers` Inherited from `stanzaprocessor.StanzaProcessor` (private): `_get_iq_handler`, `_process_handler_result`, `_process_iq_response`, `_set_response_handlers` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
Inherited from `mainloop.interfaces.TimeoutHandler`: `__abstractmethods__` Inherited from `mainloop.interfaces.TimeoutHandler` (private): `_abc_cache`, `_abc_negative_cache`, `_abc_negative_cache_version`, `_abc_registry`

Instance Variables | [hide private]
Inherited from `streambase.StreamBase`: `authenticated`, `features`, `handlers`, `initiator`, `lock`, `me`, `peer`, `peer_authenticated`, `peer_language`, `process_all_stanzas`, `settings`, `stanza_namespace`, `tls_established`, `transport`, `version` Inherited from `streambase.StreamBase` (private): `_element_handlers`, `_input_state`, `_output_state`, `_stanza_namespace_p`, `_stream_feature_handlers`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, jid, handlers, settings=None) (Constructor) |
Initialize the ClientStream object. Parameters: `jid` (JID) - local JID. `handlers` - XMPP feature and event handlers `settings` (XMPPSettings) - PyXMPP settings for the stream Overrides: object.__init__

### initiate(self, transport, to=None) |
Initiate an XMPP connection over the transport. Parameters: `transport` - an XMPP transport instance `to` - peer name (defaults to own jid domain part) Overrides: streambase.StreamBase.initiate

### receive(self, transport, myname=None) |
Receive an XMPP connection over the transport. Parameters: `transport` - an XMPP transport instance `myname` - local stream endpoint name (defaults to own jid domain part). Overrides: streambase.StreamBase.receive

### fix_out_stanza(self, stanza) |
Fix outgoing stanza. On a client clear the sender JID. On a server set the sender address to the own JID if the address is not set yet. Overrides: stanzaprocessor.StanzaProcessor.fix_out_stanza

### fix_in_stanza(self, stanza) |
Fix an incoming stanza. Ona server replace the sender address with authorized client JID. Overrides: stanzaprocessor.StanzaProcessor.fix_in_stanza