Changeset 70:34343059e52e


Ignore:
Timestamp:
Jul 21, 2009, 7:19:51 PM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@188
Message:

Use fallback port 5222 for failed SRV lookups for clients.

Author: ralphm.
Reviewer: jack.
Fixes #26.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/client.py

    r61 r70  
    147147
    148148
     149class XMPPClientConnector(SRVConnector):
     150    def __init__(self, reactor, domain, factory):
     151        SRVConnector.__init__(self, reactor, 'xmpp-client', domain, factory)
     152
     153
     154    def pickServer(self):
     155        host, port = SRVConnector.pickServer(self)
     156
     157        if not self.servers and not self.orderedServers:
     158            # no SRV record, fall back..
     159            port = 5222
     160
     161        return host, port
     162
     163
     164
    149165def clientCreator(factory):
    150166    domain = factory.authenticator.jid.host
    151     c = SRVConnector(reactor, 'xmpp-client', domain, factory)
     167    c = XMPPClientConnector(reactor, domain, factory)
    152168    c.connect()
    153169    return factory.deferred
Note: See TracChangeset for help on using the changeset viewer.