Package xmpp :: Module client :: Class CommonClient
[show private | hide private]
[frames | no frames]

Class CommonClient

Known Subclasses:
Client, Component

Base for Client and Component classes.
Method Summary
  __init__(self, server, port, debug)
Caches server name and (optionally) port to connect to.
  connect(self, server, proxy)
Make a tcp/ip connection, protect it with tls if possible and start XMPP stream.
  disconnected(self)
Called on disconnection.
  DisconnectHandler(self)
Default disconnect handler.
  event(self, eventName, args)
Default event handler.
  isConnected(self)
Returns connection state.
  reconnectAndReauth(self)
Example of reconnection method.
  RegisterDisconnectHandler(self, handler)
Register handler that will be called on disconnect.
  UnregisterDisconnectHandler(self, handler)
Unregister handler that is called on disconnect.

Method Details

__init__(self, server, port=5222, debug=['always', 'nodebuilder'])
(Constructor)

Caches server name and (optionally) port to connect to. "debug" parameter specifies
the debug IDs that will go into debug output. You can either specifiy an "include"
or "exclude" list. The latter is done via adding "always" pseudo-ID to the list.
Full list: ['nodebuilder', 'dispatcher', 'gen_auth', 'SASL_auth', 'bind', 'socket', 
 'CONNECTproxy', 'TLS', 'roster', 'browser', 'ibb'] .

connect(self, server=None, proxy=None)

Make a tcp/ip connection, protect it with tls if possible and start XMPP stream.

disconnected(self)

Called on disconnection. Calls disconnect handlers and cleans things up.

DisconnectHandler(self)

Default disconnect handler. Just raises an IOError. If you choosed to use this class in your production client, override this method or at least unregister it.

event(self, eventName, args={})

Default event handler. To be overriden.

isConnected(self)

Returns connection state. F.e.: None / 'tls' / 'tcp+non_sasl' .

reconnectAndReauth(self)

Example of reconnection method. In fact, it can be used to batch connection and auth as well.

RegisterDisconnectHandler(self, handler)

Register handler that will be called on disconnect.

UnregisterDisconnectHandler(self, handler)

Unregister handler that is called on disconnect.

Generated by Epydoc 2.1 on Sun Dec 26 09:52:57 2004 http://epydoc.sf.net