Python twisted.internet.interfaces.IReactorTCP() Examples

The following are 11 code examples of twisted.internet.interfaces.IReactorTCP(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module twisted.internet.interfaces , or try the search function .
Example #1
Source File: reactor.py    From Safejumper-for-Desktop with GNU General Public License v2.0 5 votes vote down vote up
def listenTCP(self, port, factory, backlog=50, interface=''):
        """
        @see: twisted.internet.interfaces.IReactorTCP.listenTCP
        """
        p = tcp.Port(port, factory, backlog, interface, self)
        p.startListening()
        return p 
Example #2
Source File: reactor.py    From Safejumper-for-Desktop with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #3
Source File: reactor.py    From learn_python3_spider with MIT License 5 votes vote down vote up
def listenTCP(self, port, factory, backlog=50, interface=''):
        """
        @see: twisted.internet.interfaces.IReactorTCP.listenTCP
        """
        p = tcp.Port(port, factory, backlog, interface, self)
        p.startListening()
        return p 
Example #4
Source File: reactor.py    From learn_python3_spider with MIT License 5 votes vote down vote up
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 
Example #5
Source File: trafficlogger.py    From ccs-calendarserver with Apache License 2.0 5 votes vote down vote up
def loggedReactor(reactor):
    """
    Construct and return a wrapper around the given C{reactor} which provides
    all of the same interfaces, but which will log all traffic over outgoing
    TCP connections it establishes.
    """
    bases = []
    for iface in providedBy(reactor):
        if iface is IReactorTCP:
            bases.append(_TCPTrafficLoggingReactor)
        else:
            bases.append(proxyForInterface(iface, '_reactor'))
    if bases:
        return type('(Logged Reactor)', tuple(bases), {})(reactor)
    return reactor 
Example #6
Source File: reactor.py    From python-for-android with Apache License 2.0 5 votes vote down vote up
def listenTCP(self, port, factory, backlog=50, interface=''):
        """
        @see: twisted.internet.interfaces.IReactorTCP.listenTCP
        """
        p = tcp.Port(port, factory, backlog, interface, self)
        p.startListening()
        return p 
Example #7
Source File: reactor.py    From python-for-android with Apache License 2.0 5 votes vote down vote up
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 
Example #8
Source File: posixbase.py    From python-for-android with Apache License 2.0 5 votes vote down vote up
def listenTCP(self, port, factory, backlog=50, interface=''):
        """@see: twisted.internet.interfaces.IReactorTCP.listenTCP
        """
        p = tcp.Port(port, factory, backlog, interface, self)
        p.startListening()
        return p 
Example #9
Source File: posixbase.py    From python-for-android with Apache License 2.0 5 votes vote down vote up
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) 
Example #10
Source File: posixbase.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
def listenTCP(self, port, factory, backlog=50, interface=''):
        """@see: twisted.internet.interfaces.IReactorTCP.listenTCP
        """
        p = tcp.Port(port, factory, backlog, interface, self)
        p.startListening()
        return p 
Example #11
Source File: posixbase.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
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)