in reply to network socket EOF

I know you already have a solution (using a module). But, just in case someone was curious about this problem...

If you make a HTTP 1.0 request, then you'll get EOF at the end of the data. If you make a HTTP 1.1 request, then you'll get a header telling you how many bytes to read to complete the request. (The protocol used is specified in the headers you send to the server.)

Even if you make an HTTP 1.1 request, you can terminate it by sending EOF to the server using the shutdown function which should cause the server to send back an EOF at the end of the last response.

                - tye