title: how does non-blocking tcp socket notify application on packets which fail to get sent.
body: <p>Im working on a non-blocking C tcp sockets for linux system. I've read that in non-blocking mode, the "send" command will return "bytes sent" immediately if there is no error. I'm guessing this value returned does not actually mean that those data have been delivered to the destination but rather the data has been passed to kernel memory for it to handle further and send.</p>
  
  <p>If that is the case, how would my application know which packet has really been sent out by kernel to the other end, assuming that the network connection had some problems and kernel decides to give up only after several retries in a span of a few minutes later?</p>
  
  <p>Im asking because i would want my application to resend those failed packets again at a later time.</p>