[ee122] Persistant Connections
haley.ng at gmail.com
Wed Oct 31 15:01:50 PDT 2007
On the client side, the socket is blocking, so the recv on the client side
is blocking. Therefore, if recv return 0, it means that the other side close
the connection. This is where I get the answer:
On 10/31/07, Ofer Sadgat <ofer at berkeley.edu> wrote:
> If you have a connection to a server which you send a request and request
> a persistent connection but the server refuses. In its response it includes
> a Content-Length header. As the client I parse this and receive
> content-length data. However, Once I have received the data I continue on
> with no more calls to read. However, the server now closes the connection
> and the client has no idea of this event. The client then makes a request to
> the same server and noticing that that is where it last connected it doesn't
> establish a new connection. The following recv call fails.
> How do I fix this? Is there a way to check whether or not a server has
> closed the connection without receiving data?
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ee122