[Haskell-cafe] a tiny HTTP server.. that doesn't work

Joey Adams joeyadams3.14159 at gmail.com
Tue Oct 22 02:28:11 UTC 2013


On Mon, Oct 21, 2013 at 5:15 PM, Corey O'Connor <coreyoconnor at gmail.com>wrote:

> Curiously: If the Network.HTTP.close is removed the server does not fail,
> but some requests takes several seconds to process. I presume the ordering
> of effects is then correct, but without the explicit close the close occurs
> only a GC time.
>

The client may be trying to reuse the connection; see
http://en.wikipedia.org/wiki/HTTP_persistent_connection.  This seems
consistent with your results:

 * With the close call: connection is closed right after client sends a
second request, so client whines.

 * Without the close call: client waits around for a response, then gives
up and establishes another connection.

To confirm, add another receiveHTTP call client_interact and see if it
returns another Request.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131021/70176df1/attachment.html>


More information about the Haskell-Cafe mailing list