title: ASIO - Detect dead connection
body: <p>I am trying to create an asynchronous server in C++ using Boost ASIO library, it goes by standard model provided at their webpage, ioservice and worker (session)
  I am using something like this:</p>
  
  <pre><code>asio::async_read(socket,buffer(data,datalen),[=]( error , len ){
       if(error || len==0) disconnect(); else processRequest(data,len);
  })
  </code></pre>
  
  <p>Firstly, it works just fine, when user opens and closes connection - OS does the job.</p>
  
  <p>But problem comes when user disconnects from internet by force, socket remains in "ESTABLISHED" state, though user is already gone, yeah, how would OS handle sending TCP close packet, when internet is not available anymore?</p>
  
  <p>Also problem comes with telephony internet networks, user travels, switches zone from HSDPA to no internet and finally GPRS, old HSDPA socket remains "ESTABLISHED", though user already doesn't use it.</p>
  
  <p>How to detect dead connections like this?</p>