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

Class Client

CommonClient --+
               |
              Client


Example client class, based on CommonClient.
Method Summary
  auth(self, user, password, resource)
Authenticate connnection and bind resource.
  connect(self, server, proxy)
Connect to jabber server.
  getRoster(self)
Return the Roster instance, previously plugging it in and requesting roster from server if needed.
  sendInitPresence(self, requestRoster)
Send roster request and initial <presence/>.
  sendPresence(self, jid, typ, requestRoster)
Send some specific presence state.
    Inherited from CommonClient
  __init__(self, server, port, debug)
Caches server name and (optionally) port to connect to.
  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

auth(self, user, password, resource='')

Authenticate connnection and bind resource. If resource is not provided random one or library name used.

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

Connect to jabber server. If you want to specify different ip/port to connect to you can pass it as tuple as first parameter. If there is HTTP proxy between you and server - specify it's address and credentials (if needed) in the second argument. Example: connect(('192.168.5.5':5222),{'host':'proxy.my.net','port':8080,'user':'me','password':'secret'})
Overrides:
xmpp.client.CommonClient.connect

getRoster(self)

Return the Roster instance, previously plugging it in and requesting roster from server if needed.

sendInitPresence(self, requestRoster=1)

Send roster request and initial <presence/>. You can disable the first by setting requestRoster argument to 0.

sendPresence(self, jid=None, typ=None, requestRoster=0)

Send some specific presence state. Can also request roster from server if according agrument is set.

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