<HTML>
<HEAD>
<TITLE>Re: [Twisted-Python] Flush socket</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>well, it does not necessarily correspond, but from what I see on tcpdump with<BR>
loopback device and on LAN (with TCP NoDelay set), it practically works.<BR>
<BR>
the problem with your suggestion: I want to test the other end .. and that is<BR>
not Twisted (its i.e. Firefox .. the protocol to test is WebSockets)<BR>
<BR>
<BR>
On 11.08.11 23:13, &quot;Christopher Armstrong&quot; &lt;<a href="radix@twistedmatrix.com">radix@twistedmatrix.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
On Thu, Aug 11, 2011 at 5:06 PM, Tobias Oberstein &lt;<a href="tobias.oberstein@tavendo.de">tobias.oberstein@tavendo.de</a>&gt; wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
While this is a noble goal, your method isn'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'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.<BR>
<BR>
-- <BR>
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>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>