module documentation
Various helpers for tests for connection-oriented transports.
Class |
|
A context factory with a broken getContext method, for exercising the error handling for such a case. |
Class |
|
ClosingLaterProtocol exchanges one byte with its peer and then disconnects itself. This is mostly a work-around for the fact that connectionMade is called before the SSL handshake has completed. |
Class |
|
A protocol to be used with runProtocolsWithReactor . |
Class |
|
This mixin defines test methods which should apply to most ITransport implementations. |
Class |
|
Create client and server endpoints that know how to connect to each other. |
Class |
|
Mixin for TestCase subclasses which want to observe log events. |
Class |
|
A client factory which stops a reactor when a connection attempt fails. |
Class |
|
This mixin defines tests applicable to SOCK_STREAM client implementations. |
Function | find |
Ask the platform to allocate a free port on the specified interface, then release the socket and return the address which was allocated. |
Function | run |
Connect two protocols using endpoints and a new reactor instance. |
Class | _ |
This factory fires a Deferred with a protocol instance shortly after it is constructed (hopefully long enough afterwards so that it has been connected to a transport). |
Class | _ |
A pull producer which writes one byte whenever it is resumed. For use by test_unregisterProducerAfterDisconnect. |
Class | _ |
Factory to be used by runProtocolsWithReactor . |
Function | _get |
Like IReactorFDSet.getWriters , but with support for IOCP reactor as well. |
Ask the platform to allocate a free port on the specified interface, then release the socket and return the address which was allocated.
Parameters | |
interface:str | The local address to try to bind the port on. |
family | Undocumented |
type | The socket type which will use the resulting port. |
Returns | |
A two-tuple of address and port, like that returned by socket.getsockname . |
Connect two protocols using endpoints and a new reactor instance.
A new reactor will be created and run, with the client and server protocol instances connected to each other using the given endpoint creator. The protocols should run through some set of tests, then disconnect; when both have disconnected the reactor will be stopped and the function will return.
Parameters | |
reactor | A ReactorBuilder instance. |
server | A ConnectableProtocol that will be the server. |
client | A ConnectableProtocol that will be the client. |
endpoint | An instance of EndpointCreator . |
Returns | |
The reactor run by this test. |