Package xmpp :: Module client :: Class Component

[hide private]
[frames] | no frames]

# Class Component

source code

    CommonClient --+
                   |
                  Component

Component class. The only difference from CommonClient is ability to perform component authentication.

Instance Methods | [hide private]

__init__(self, server, port=5347, typ=None, debug=`[``'``always``'``,` `'``nodebuilder``'``]`, domains=None, sasl=0, bind=0, route=0, xcp=0) Init function for Components. | source code

connect(self, server=None, proxy=None) This will connect to the server, and if the features tag is found then set the namespace to be jabber:client as that is required for jabberd2. | source code

dobind(self, sasl) | source code

auth(self, name, password, dup=None) Authenticate component "name" with password "password". | source code

Inherited from `CommonClient`: `DisconnectHandler`, `RegisterDisconnectHandler`, `UnregisterDisconnectHandler`, `disconnected`, `event`, `isConnected`, `reconnectAndReauth`

Method Details | [hide private]

### __init__(self, server, port=5347, typ=None, debug=`[``'``always``'``,` `'``nodebuilder``'``]`, domains=None, sasl=0, bind=0, route=0, xcp=0)
(Constructor)

source code

Init function for Components. As components use a different auth mechanism which includes the namespace of the component. Jabberd1.4 and Ejabberd use the default namespace then for all client messages. Jabberd2 uses jabber:client. 'server' argument is a server name that you are connecting to (f.e. "localhost"). 'port' can be specified if 'server' resolves to correct IP. If it is not then you'll need to specify IP and port while calling "connect()".

Overrides: CommonClient.__init__

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

source code

This will connect to the server, and if the features tag is found then set the namespace to be jabber:client as that is required for jabberd2. 'server' and 'proxy' arguments have the same meaning as in xmpp.Client.connect()

Overrides: CommonClient.connect