Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::asio - how to detect if a remotesocketsclient has disconnected
From: Alex Black (alex_at_[hidden])
Date: 2009-07-27 13:05:29


> On Mon, Jul 27, 2009 at 10:14 AM, Alex Black<alex_at_[hidden]> wrote:
> > Would doing synchronous writes (instead of asycnchronous
> writes) make
> > any difference?
>
> No. It still needs to fill up the TCP send buffer before it
> even considers raising any sort of error.
>
> If one end of the connection silently drops off, the only
> reliable way to find out is to attempt a read.

So, if I attempt a read, will I be able to distinguish between these two
scenarios:
A) the client is no longer connected
B) the client is connected but hasn't send anything since I last read
(which is the case for HTTP clients I believe)

>
> Jon
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net