twisted.internet.testing.StringTransportWithDisconnection(StringTransport) class documentationtwisted.internet.testing
(View In Hierarchy)
Known subclasses: twisted.internet.test.test_endpoints.MemoryProcessTransport
A StringTransport
which on disconnection will trigger the connection lost on the attached 
protocol.
| Method | loseConnection | Close the connection. Does nothing besides toggle the disconnectinginstance variable toTrue. | 
Inherited from StringTransport:
| Instance Variable | disconnecting | A boolwhich isFalseuntilloseConnectionis called, thenTrue. | 
| Instance Variable | disconnected | A boolwhich isFalseuntilabortConnectionis called, thenTrue. | 
| Instance Variable | producer | If a producer is currently registered, produceris a reference
to it.  Otherwise,None. | 
| Instance Variable | streaming | If a producer is currently registered, streamingrefers to the
value of the second parameter passed toregisterProducer. | 
| Instance Variable | hostAddr | Noneor an object which will be returned as the host address of this transport.
IfNone,
a nasty tuple will be returned instead. | 
| Instance Variable | peerAddr | Noneor an object which will be returned as the peer address of this transport.
IfNone,
a nasty tuple will be returned instead. | 
| Instance Variable | producerState | The state of this StringTransportin its capacity as anIPushProducer.
One of'producing','paused', or'stopped'. | 
| Instance Variable | io | A io.BytesIOwhich holds the data which has been written to this transport since the 
last call toclear.
Usevalueinstead of accessing this directly. | 
| Method | __init__ | Undocumented | 
| Method | clear | Discard all data written to this transport so far. | 
| Method | value | Retrieve all data which has been buffered by this transport. | 
| Method | write | Write some data to the physical connection, in sequence, in a non-blocking fashion. | 
| Method | writeSequence | Write an iterable of byte strings to the physical connection. | 
| Method | abortConnection | Abort the connection. Same as loseConnection, but also 
toggles theabortedinstance variable toTrue. | 
| Method | getPeer | Get the remote address of this connection. | 
| Method | getHost | Similar to getPeer, but returns an address describing this side of the connection. | 
| Method | registerProducer | Register to receive data from a producer. | 
| Method | unregisterProducer | Stop consuming data from a producer, without disconnecting. | 
| Method | pauseProducing | Pause producing data. | 
| Method | stopProducing | Stop producing data. | 
| Method | resumeProducing | Resume producing data. | 
| Instance Variable | _lenient | By default StringTransportenforces thatresumeProducingis not called after the connection is lost. This is to ensure that any code
that does callresumeProducingafter the connection is lost is not blindly expectingresumeProducingto have any impact.However, if your test case is calling  Defaults to  | 
| Method | _checkState | Undocumented |