27 Jul
2009
27 Jul
'09
5:20 p.m.
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)
Yes, if you call async_read(), then in case of (A) your handler will be called with some error_code (eg. eof), while in (B) nothing would happen - async.read is pending until there's some data or error.