xmpp.client.Client

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

# Class Client

source code

    CommonClient --+
                   |
                  Client

Example client class, based on CommonClient.

Instance Methods | [hide private]
connect(self, server=None, proxy=None, secure=None, use_srv=True) Connect to jabber server. | source code
auth(self, user, password, resource=`'````'`, sasl=1) Authenticate connnection and bind resource. | source code
getRoster(self) Return the Roster instance, previously plugging it in and requesting roster from server if needed. | source code
sendInitPresence(self, requestRoster=1) Send roster request and initial <presence/>. | source code
sendPresence(self, jid=None, typ=None, requestRoster=0) Send some specific presence state. | source code
Inherited from `CommonClient`: `DisconnectHandler`, `RegisterDisconnectHandler`, `UnregisterDisconnectHandler`, `__init__`, `disconnected`, `event`, `isConnected`, `reconnectAndReauth`

Method Details | [hide private]

### connect(self, server=None, proxy=None, secure=None, use_srv=True) | source code
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. If you want ssl/tls support to be discovered and enable automatically - leave third argument as None. (ssl will be autodetected only if port is 5223 or 443) If you want to force SSL start (i.e. if port 5223 or 443 is remapped to some non-standard port) then set it to 1. If you want to disable tls/ssl support completely, set it to 0. Example: connect(('192.168.5.5',5222),{'host':'proxy.my.net','port':8080,'user':'me','password':'secret'}) Returns '' or 'tcp' or 'tls', depending on the result. Overrides: CommonClient.connect

### auth(self, user, password, resource=`'````'`, sasl=1) | source code
Authenticate connnection and bind resource. If resource is not provided random one or library name used.

### sendInitPresence(self, requestRoster=1) | source code
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) | source code
Send some specific presence state. Can also request roster from server if according agrument is set.