
8 Jul
2010
8 Jul
'10
2:24 p.m.
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_read on that socket, and in most cases it will call its handler with some error. But this method doesn't always work - eg., in case of a "non-graceful" cable disconnection.