logo       

Re: Testing socket for disconnect: msg#00034

lib.boost.asio.user

Subject: Re: Testing socket for disconnect

Edit - perhaps you could just leave a long-running async_read_some()
operation going when idle?

Richard

On 11/29/06, Richard Dingwall
<rdingwall-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote:
> To answer you first question -
>
> as I understand it, there's no way to tell if the socket is still
> connected without select()-ing* on it. So you will need some sort of
> session-layer protocol no-op command that can be sent at intervals to
> poll for (detect) disconnections.
>
> I may be wrong!
>
> Richard
>
> * or kqueue(), poll(), epoll() etc, performed by boost::asio
>
> On 11/29/06, Stas Khirman <staskh-Wuw85uim5zDR7s880joybQ@xxxxxxxxxxxxxxxx>
> wrote:
> > Hi,
> >
> > What is 'ASIO-approved' way to check if TCP socket had been disconnected by
> > remote peer while no outstanding read/write operation.
> >
> > Related question - Did I understand correctly that if I have an outstanding
> > read/write it will be completed with asio::error:: connection_aborted error
> > on remote peer disconnect ? .
> >
> > Stas
> >
> >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys - and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > asio-users mailing list
> > asio-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> > https://lists.sourceforge.net/lists/listinfo/asio-users
> >
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise