<br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 2:30 PM, Paul Wiseman <span dir="ltr">&lt;<a href="mailto:poalman@gmail.com" target="_blank">poalman@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
I&#39;m trying to reproduce it with a small twisted client and server,<br>
using a PUT request to send to the server but I can&#39;t seem to close<br>
the connection uncleanly. How would you recommend I do that? I&#39;ve<br>
tried adding request.finish() on a callLater but that seems to finish<br>
the connection in a clean way. How can I close the connection in the<br>
way you suggest?<br></blockquote><div><br>Maybe don&#39;t even go with real HTTP server, but something like:<br><br>class HTTP(Protocol):<br>    def connectionMade(self):<br>        time.sleep(1)<br>        self.transport.write(&quot;HTTP/1.0 200 OK\r\nContent-Length: 300000: \r\n\r\n&quot;)<br>
        self.transport.loseConnection()<br><br>Or some variation on that, where you can control exactly where things break.<br><br></div></div>-- <br>Itamar Turner-Trauring, Future Foundries LLC<br><a href="http://futurefoundries.com/" target="_blank">http://futurefoundries.com/</a> — Twisted consulting, training and support.<br>