Boost logo

Boost Users :

Subject: Re: [Boost-users] asio, check remote socket open
From: Lloyd (lloyd_at_[hidden])
Date: 2010-07-08 10:59:20

I am not in a position to call async_read, as it will read out some valuable
data (if the connection is not closed).

Al least is there any "dirty way" to do this?

Thanks a lot,

----- Original Message -----
From: "Igor R" <boost.lists_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Thursday, July 08, 2010 7:54 PM
Subject: Re: [Boost-users] asio, check remote socket open

>> Inside the timer handler routine, is there any way to chek the connection
>> is closed or> not? (From the timer handler, I can access the socket and
>> io_service).
> Not really. To detect peer disconnection you can perform an async_readon
> that socket, and in most cases it will call its handler with someerror.
> But this method doesn't always work - eg., in case of a"non-graceful"
> cable
> disconnection._______________________________________________Boost-users
> mailing
> listBoost-users_at_[hidden]

Scanned and protected by Email scanner

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at