<br><div class="gmail_quote">On Thu, Aug 11, 2011 at 5:06 PM, Tobias Oberstein <span dir="ltr">&lt;<a href="mailto:tobias.oberstein@tavendo.de">tobias.oberstein@tavendo.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
For testing implementations of a TCP-based protocol, I am testing<br>
if an implementation is agnostic wrt to in what chops in receives<br>
octets from the wire (&quot;stream clean&quot;).<br>
<br>
To do that, I force out octets from the protocol test driver (written<br>
in Twisted) in differently sized chops, down to single octets.<br>
<br></blockquote><div><br></div><div>While this is a noble goal, your method isn&#39;t really right: in TCP, the chunks you write on one end do not correspond to the chunks you receive on the other end after they&#39;ve gone through a TCP stack and network. The best way to verify that your client is stream clean is to write unit tests that explicitly call its dataReceived method with different-sized chunks.</div>
<div><br></div><div>-- </div></div>Christopher Armstrong<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://planet-if.com/">http://planet-if.com/</a><br><br><br>