module documentation
(source)

Testing support for protocols -- loopback between client and server.
Class ​Loopback​Client​Factory Undocumented
Class ​Loopback​Relay Undocumented
Function collapsing​Pump​Policy collapsingPumpPolicy is a policy which collapses all outstanding chunks into a single string and delivers it to the target.
Function identity​Pump​Policy identityPumpPolicy is a policy which delivers each chunk of data written to the given queue as-is to the target.
Function loopback​Async Establish a connection between server and client then transfer data between them until the connection is closed. This is often useful for testing a protocol.
Function loopback​TCP Run session between server and client protocol instances over TCP.
Function loopback​UNIX Run session between server and client protocol instances over UNIX socket.
Class _​Fire​On​Close Undocumented
Class _​Loopback​Address Undocumented
Class _​Loopback​Queue Trivial wrapper around a list to give it an interface like a queue, which the addition of also sending notifications by way of a Deferred whenever the list has something added to it.
Class _​Loopback​Transport No class docstring; 0/3 instance variable, 0/1 class variable, 1/10 method documented
Function _loopback​Async​Body Transfer bytes from the output queue of each protocol to the input of the other.
Function _loopback​Async​Continue Undocumented
def collapsingPumpPolicy(queue, target): (source)
collapsingPumpPolicy is a policy which collapses all outstanding chunks into a single string and delivers it to the target.
See Also
loopbackAsync
def identityPumpPolicy(queue, target): (source)

identityPumpPolicy is a policy which delivers each chunk of data written to the given queue as-is to the target.

This isn't a particularly realistic policy.

See Also
loopbackAsync
def loopbackAsync(server, client, pumpPolicy=identityPumpPolicy): (source)
Establish a connection between server and client then transfer data between them until the connection is closed. This is often useful for testing a protocol.
Parameters
serverThe protocol instance representing the server-side of this connection.
clientThe protocol instance representing the client-side of this connection.
pump​PolicyWhen either server or client writes to its transport, the string passed in is added to a queue of data for the other protocol. Eventually, pumpPolicy will be called with one such queue and the corresponding protocol object. The pump policy callable is responsible for emptying the queue and passing the strings it contains to the given protocol's dataReceived method. The signature of pumpPolicy is (queue, protocol). queue is an object with a get method which will return the next string written to the transport, or None if the transport has been disconnected, and which evaluates to True if and only if there are more items to be retrieved via get.
Returns
A Deferred which fires when the connection has been closed and both sides have received notification of this.
def loopbackTCP(server, client, port=0, noisy=True): (source)
Run session between server and client protocol instances over TCP.
def loopbackUNIX(server, client, noisy=True): (source)
Run session between server and client protocol instances over UNIX socket.
def _loopbackAsyncBody(server, serverToClient, client, clientToServer, pumpPolicy): (source)
Transfer bytes from the output queue of each protocol to the input of the other.
Parameters
serverThe protocol instance representing the server-side of this connection.
server​To​ClientThe _LoopbackQueue holding the server's output.
clientThe protocol instance representing the client-side of this connection.
client​To​ServerThe _LoopbackQueue holding the client's output.
pump​PolicySee loopbackAsync.
Returns
A Deferred which fires when the connection has been closed and both sides have received notification of this.
def _loopbackAsyncContinue(ignored, server, serverToClient, client, clientToServer, pumpPolicy): (source)

Undocumented