Boost logo

Boost Users :

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


> > My server is a basic HTTP server, and if the client has
> disconnected
> > while I'm still processing their request I'd like to abort the
> > processing (e.g. no point doing work if the client is not there
> > waiting for the data).
>
> How would you do this without ASIO, with plain sockets?

I don't know the answer to that either. As you are implying, this
question isn't necessarily ASIO specific.

>
> > I've read I can try to read from the socket, but in HTTP the client
> > sends the request, and doesn't write any more to the socket.
>
> Probably you can try to write back to the socket, and check
> if this operation fails?

I'm writing back using async_write and they seem to succeed. I might
try writing back synchronously...


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