<br><br>On Thursday, July 12, 2012, Russell E. Owen  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m adding Twisted support to some existing communication code and I<br>

have a few questions which I hope are simple. I&#39;ve been reading the API<br>
documentation, but if the answers are there I&#39;m missing them.<br>
<br>
What happens if one tries to write to a protocol.transport that is not<br>
connected or in an error state? (I&#39;m hoping that this case has defined<br>
behavior and that it will raise an exception).</blockquote><div><br></div><div>Not connected usually means that protocol.transport is None</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Is there some way to query a protocol to see if it is in a good state<br>
(connected and no errors)? I realize with callbacks this is not usually<br>
necessary, but I have a case where it would be helpful (though I can<br>
probably manage without it).</blockquote><div><br></div><div>Can you elaborate on the case?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
When reading raw bytes, is there any way to get the bytes from the<br>
protocol? I assume not: that if one wants to buffer the data one must do<br>
that in the callback. If so, does Twisted provide a suitable buffer<br>
class?</blockquote><div><br></div><div>The protocol gets dataReceivrd called. What kind of buffering do you want to do and why? Would a simple StringIO suffice?<span></span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
-- Russell<br>
<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;Twisted-Python@twistedmatrix.com&#39;)">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote><br><br>-- <br>cheers<div>lvh</div><br>