<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Aug 11, 2011, at 7:43 PM, <a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">This will always be a somewhat unreliable way to test a remote process's<span class="Apple-converted-space">&nbsp;</span><br>handling of packetization, since there are still two TCP/IP stacks which<span class="Apple-converted-space">&nbsp;</span><br>can mess around with the data in a variety of ways, but it's as good as<span class="Apple-converted-space">&nbsp;</span><br>you can do if you want to use normal sockets for this testing.<br></span></span></blockquote></div><br><div>This bears repeating. &nbsp;It's really unreliable. &nbsp;Really. &nbsp;The sizes of buffers passed to send() and recv() bear only a coincidental resemblance to each other; one test setup may reproduce them reliably when the next will suddenly behave completely differently. &nbsp;If you want even a reasonably reliable heuristic here, you need to send() and then introduce a delay. &nbsp;You can do this without your own IWriteDescriptor implementation though; just implement an ITransport that does its write() by breaking things up and then calling the underlying write() with callLater()s in-between.</div><div><br></div><div>-glyph</div></body></html>