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.

Instance Methods [hide private]
 
__init__(self, jid, stanza_route, 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, send, send_stream_error, set_authenticated, set_peer_authenticated, stream_element, stream_end, stream_eof, stream_parse_error, stream_start, transport_connected, uplink_receive, write_element

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]

Inherited from streambase.StreamBase: authenticated, features, handlers, initiator, lock, me, peer, peer_authenticated, peer_language, settings, stanza_namespace, tls_established, transport, version

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, jid, stanza_route, 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: streambase.StreamBase.fix_out_stanza

fix_in_stanza(self, stanza)

 

Fix an incoming stanza.

Ona server replace the sender address with authorized client JID.

Overrides: streambase.StreamBase.fix_in_stanza