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


Python tcp.Connector方法代码示例

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


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

示例1: connectUNIX

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def connectUNIX(self, address, factory, timeout=30, checkPID=0):
        assert unixEnabled, "UNIX support is not present"
        c = unix.Connector(address, factory, timeout, self, checkPID)
        c.connect()
        return c 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:7,代码来源:posixbase.py

示例2: connectTCP

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def connectTCP(self, host, port, factory, timeout=30, bindAddress=None):
        c = tcp.Connector(host, port, factory, timeout, bindAddress, self)
        c.connect()
        return c

    # IReactorSSL (sometimes, not implemented) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:8,代码来源:posixbase.py

示例3: connectSSL

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def connectSSL(self, host, port, factory, contextFactory, timeout=30, bindAddress=None):
        if tls is not None:
            tlsFactory = tls.TLSMemoryBIOFactory(contextFactory, True, factory)
            return self.connectTCP(host, port, tlsFactory, timeout, bindAddress)
        elif ssl is not None:
            c = ssl.Connector(
                host, port, factory, contextFactory, timeout, bindAddress, self)
            c.connect()
            return c
        else:
            assert False, "SSL support is not present" 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:13,代码来源:posixbase.py

示例4: __init__

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def __init__(self, host, port, factory, contextFactory, timeout, bindAddress, reactor=None):
        self.contextFactory = contextFactory
        tcp.Connector.__init__(self, host, port, factory, timeout, bindAddress, reactor)

        # Force some parameter checking in pyOpenSSL.  It's better to fail now
        # than after we've set up the transport.
        contextFactory.getContext() 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:9,代码来源:ssl.py

示例5: test_tcp_repr

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def test_tcp_repr(self):
        c = Connector('localhost', 666, object(), 0, object())
        expect = "<twisted.internet.tcp.Connector instance at 0x%x " \
            "disconnected %s>"
        expect = expect % (id(c), c.getDestination())
        self.assertEqual(repr(c), expect) 
开发者ID:wistbean,项目名称:learn_python3_spider,代码行数:8,代码来源:test_internet.py

示例6: connectUNIX

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def connectUNIX(self, address, factory, timeout=30, checkPID=0):
        """@see: twisted.internet.interfaces.IReactorUNIX.connectUNIX
        """
        assert unixEnabled, "UNIX support is not present"
        c = unix.Connector(address, factory, timeout, self, checkPID)
        c.connect()
        return c 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:9,代码来源:posixbase.py

示例7: connectTCP

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def connectTCP(self, host, port, factory, timeout=30, bindAddress=None):
        """@see: twisted.internet.interfaces.IReactorTCP.connectTCP
        """
        c = tcp.Connector(host, port, factory, timeout, bindAddress, self)
        c.connect()
        return c

    # IReactorSSL (sometimes, not implemented) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:10,代码来源:posixbase.py

示例8: connectSSL

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def connectSSL(self, host, port, factory, contextFactory, timeout=30, bindAddress=None):
        """@see: twisted.internet.interfaces.IReactorSSL.connectSSL
        """
        assert sslEnabled, "SSL support is not present"
        c = ssl.Connector(host, port, factory, contextFactory, timeout, bindAddress, self)
        c.connect()
        return c 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:9,代码来源:posixbase.py

示例9: __init__

# 需要导入模块: from twisted.internet import tcp [as 别名]
# 或者: from twisted.internet.tcp import Connector [as 别名]
def __init__(self, host, port, factory, timeout, bindAddress, reactor):
        tcp.Connector.__init__(self, host, int(port), factory, timeout, bindAddress, reactor) 
开发者ID:EricssonResearch,项目名称:calvin-base,代码行数:4,代码来源:bt.py


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