[Twisted-Python] A few simple questions

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Thu Jul 12 11:52:15 MDT 2012


On 04:02 pm, _ at lvh.cc wrote:
>On Thursday, July 12, 2012, Russell E. Owen wrote:
>>I'm adding Twisted support to some existing communication code and I
>>have a few questions which I hope are simple. I've been reading the 
>>API
>>documentation, but if the answers are there I'm missing them.
>>
>>What happens if one tries to write to a protocol.transport that is not
>>connected or in an error state? (I'm hoping that this case has defined
>>behavior and that it will raise an exception).
>
>
>Not connected usually means that protocol.transport is None

I don't think you'll find this to be true.

Not connected means makeConnection hasn't yet been called or 
connectionLost has been called.  Anything else you want, you need to 
build yourself (and given those two callbacks, it should be obvious how 
to build something simple to tell you this).

Jean-Paul




More information about the Twisted-Python mailing list