title: server sending reset signal instead of FIN
body: <p>I am learning tcp-ip stack, server-client connections. I wrote a simple client server. The client and servers were able to transfer data to each other without any issues. I am running client and server on the same machine. When I used to close the server with ctrl+c, I found kernel was sending RST signal instead of FIN. (Please refer my question: <a href="https://stackoverflow.com/questions/14737896/active-closure-of-server-sockets">Active closure of server sockets</a> )</p>
  
  <p>With little more investigation, I realized one of my client was in read call and corresponding server thread was in infinite while loop doing nothing (Some buggy dumb coding on my part). But when I removed that infinite while loop, I saw expected behavior. I could see FIN being sent in both the directions. </p>
  
  <p>So, I am wondering why tcp layer was sending RST in first case. </p>