[Twisted-Python] A few simple questions

Russell E. Owen rowen at uw.edu
Thu Jul 12 11:36:39 EDT 2012


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).

Is there some way to query a protocol to see if it is in a good state 
(connected and no errors)? I realize with callbacks this is not usually 
necessary, but I have a case where it would be helpful (though I can 
probably manage without it).

When reading raw bytes, is there any way to get the bytes from the 
protocol? I assume not: that if one wants to buffer the data one must do 
that in the callback. If so, does Twisted provide a suitable buffer 
class?

-- Russell




More information about the Twisted-Python mailing list