当前位置: 首页>>代码示例>>Python>>正文


Python SRVConnector.pickServer方法代码示例

本文整理汇总了Python中twisted.names.srvconnect.SRVConnector.pickServer方法的典型用法代码示例。如果您正苦于以下问题:Python SRVConnector.pickServer方法的具体用法?Python SRVConnector.pickServer怎么用?Python SRVConnector.pickServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.names.srvconnect.SRVConnector的用法示例。


在下文中一共展示了SRVConnector.pickServer方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
    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
开发者ID:cwaldbieser,项目名称:ldaptor,代码行数:29,代码来源:ldapconnector.py

示例2: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
    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
开发者ID:Ri0n,项目名称:Hermes,代码行数:10,代码来源:xmpp.py

示例3: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
    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
开发者ID:kkszysiu,项目名称:pynktalk,代码行数:10,代码来源:xmpp_client.py

示例4: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
    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)
开发者ID:grengojbo,项目名称:python-msrplib,代码行数:11,代码来源:connect.py

示例5: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
    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
开发者ID:apostolelvis,项目名称:punjab,代码行数:15,代码来源:session.py

示例6: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
    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
开发者ID:PADGETS-EU,项目名称:padgets-repo,代码行数:18,代码来源:session.py

示例7: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
 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
开发者ID:ByteInternet,项目名称:eventlet,代码行数:6,代码来源:twisted_srvconnector.py

示例8: pickServer

# 需要导入模块: from twisted.names.srvconnect import SRVConnector [as 别名]
# 或者: from twisted.names.srvconnect.SRVConnector import pickServer [as 别名]
 def pickServer(self):
     host, port = SRVConnector.pickServer(self)
     if not self.servers and not self.orderedServers:
         port = 5222
     return host, port
开发者ID:chmouel,项目名称:irssi-xmpp-notify,代码行数:7,代码来源:xmpp-notify.py


注:本文中的twisted.names.srvconnect.SRVConnector.pickServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。