[ee122] Persistant Connections

Haley Nguyen 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:
http://mkssoftware.com/docs/man3/recv.3.asp.

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?
>
>
>
> Thanks,
>
> Ofer
>
> _______________________________________________
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122
>
>


-- 
Haley Nguyen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/ee122/attachments/20071031/e1ec513c/attachment.html 


More information about the ee122 mailing list