示例#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
示例#2
0
文件: xmpp.py 项目: 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
示例#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
示例#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
示例#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
示例#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)
示例#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)
示例#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
示例#9
0
文件: session.py 项目: eadev/punjab
    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
示例#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
示例#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
示例#14
0
 def pickServer(self):
     host, port = SRVConnector.pickServer(self)
     if not self.servers and not self.orderedServers:
         port = 5222
     return host, port
示例#15
0
 def pickServer(self):
     host, port = SRVConnector.pickServer(self)
     if not self.servers and not self.orderedServers:
         port = 5222
     return host, port