當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。