Esempio n. 1
0
    def pickServer(self):
        if self.override is None:
            overriddenHost, overriddenPort = None, None
        else:
            overriddenHost, overriddenPort = self.override

        if (overriddenHost is not None
            and (overriddenPort is not None
                 or self.domain is None)):
            host = overriddenHost
            port = overriddenPort
        else:
            host, port = SRVConnector.pickServer(self)
            if overriddenHost is not None:
                host = overriddenHost
            if overriddenPort is not None:
                port = overriddenPort

        try:
            port = int(port)
        except ValueError:
            pass

        assert host is not None
        if port is None:
            port = 389
        return host, port
Esempio n. 2
0
File: xmpp.py Progetto: Ri0n/Hermes
    def pickServer(self):
        host, port = SRVConnector.pickServer(self)

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            port = int(config()['xmpp']['port'])

        return host, port
Esempio n. 3
0
    def pickServer(self):
        host, port = SRVConnector.pickServer(self)

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            port = 5222

        return host, port
Esempio n. 4
0
    def pickServer(self):
        host, port = SRVConnector.pickServer(self)

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            port = int(config()['xmpp']['port'])

        return host, port
Esempio n. 5
0
    def pickServer(self):
        host, port = SRVConnector.pickServer(self)

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            port = 5222

        return host, port
Esempio n. 6
0
    def pickServer(self):
        assert self.servers is not None
        assert self.orderedServers is not None

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            return self.domain, 2855

        return SRVConnector.pickServer(self)
Esempio n. 7
0
    def pickServer(self):
        assert self.servers is not None
        assert self.orderedServers is not None

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            return self.domain, 2855

        return SRVConnector.pickServer(self)
Esempio n. 8
0
    def pickServer(self):
        """
        Pick a server and port to make the connection.
        """
        host, port = SRVConnector.pickServer(self)

        if port == 5223 and ssl:
            context = ssl.ClientContextFactory()
            context.method = ssl.SSL.SSLv23_METHOD

            self.connectFuncName = 'connectSSL'
            self.connectFuncArgs = (context,)
        return host, port
Esempio n. 9
0
    def pickServer(self):
        """
        Pick a server and port to make the connection.
        """
        host, port = SRVConnector.pickServer(self)

        if port == 5223 and ssl:
            context = ssl.ClientContextFactory()
            context.method = ssl.SSL.SSLv23_METHOD

            self.connectFuncName = 'connectSSL'
            self.connectFuncArgs = (context, )
        return host, port
Esempio n. 10
0
    def pickServer(self):
        """
        Pick a server and port to make the connection.
        """
        host, port = SRVConnector.pickServer(self)

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            port = 5222
        if port == 5223 and xmlstream.ssl:
            context = xmlstream.ssl.ClientContextFactory()
            context.method = xmlstream.ssl.SSL.SSLv23_METHOD
            
            self.connectFunc = 'connectSSL'
            self.connectFuncArgs = (context)
        return host, port
Esempio n. 11
0
    def pickServer(self):
        """
        Pick a server and port to make the connection.
        """
        host, port = SRVConnector.pickServer(self)

        if not self.servers and not self.orderedServers:
            # no SRV record, fall back..
            port = 5222
        if port == 5223 and xmlstream.ssl:
            context = xmlstream.ssl.ClientContextFactory()
            context.method = xmlstream.ssl.SSL.SSLv23_METHOD

            self.connectFunc = 'connectSSL'
            self.connectFuncArgs = (context)
        return host, port
 def pickServer(self):
     host, port = SRVConnector.pickServer(self)
     print 'Resolved _%s._%s.%s --> %s:%s' % (self.service, self.protocol,
                                              self.domain, host, port)
     return host, port
 def pickServer(self):
     host, port = SRVConnector.pickServer(self)
     print('Resolved _%s._%s.%s --> %s:%s' % (self.service, self.protocol, self.domain, host, port))
     return host, port
Esempio n. 14
0
 def pickServer(self):
     host, port = SRVConnector.pickServer(self)
     if not self.servers and not self.orderedServers:
         port = 5222
     return host, port
Esempio n. 15
0
 def pickServer(self):
     host, port = SRVConnector.pickServer(self)
     if not self.servers and not self.orderedServers:
         port = 5222
     return host, port