A ConnectionCompleter can cause synthetic TCP connections established by MemoryReactor.connectTCP and MemoryReactor.listenTCP to succeed or fail.

Method __init__ Create a ConnectionCompleter from a MemoryReactor.
Method succeedOnce Complete a single TCP connection established on this ConnectionCompleter's MemoryReactor.
Method failOnce Fail a single TCP connection established on this ConnectionCompleter's MemoryReactor.
def __init__(self, memoryReactor):

Create a ConnectionCompleter from a MemoryReactor.

ParametersmemoryReactorThe reactor to attach to. (type: MemoryReactor)
def succeedOnce(self, debug=False):

Complete a single TCP connection established on this ConnectionCompleter's MemoryReactor.

ParametersdebugA flag; whether to dump output from the established connection to stdout. (type: bool)
Returnsa pump for the connection, or None if no connection could be established. (type: IOPump or None)
def failOnce(self, reason=Failure(ConnectionRefusedError())):

Fail a single TCP connection established on this ConnectionCompleter's MemoryReactor.

Parametersreasonthe reason to provide that the connection failed. (type: Failure)
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.