title: Client is not sending ACK in response to server's FIN ACK in Python
body: <p>I am using the socket library in python and to connect to a server. After connecting, the server will automatically transmit packets and then terminate the connection. I am having issues completing the proper hand shaking to close the connection.</p>
  <p>After receiving the server's packets, I set an indefinite while loop to wait for the server to initiate the close:</p>
  <pre><code>import socket
  
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect((ip_address, port))
  
  ...
  # Get packets
  ...
  
  # Wait for server to close connection
  while True:
      new_msg = s.recv(1024)
      if len(new_msg) &lt;= 0:
          break
  </code></pre>
  <p>With this code, I see the following network traffic for the closing process:</p>
  <pre><code>Server -&gt; Client: FIN, ACK
  Client -&gt; Server: FIN, ACK
  Server -&gt; Client: ACK
  </code></pre>
  <p>I would like to see:</p>
  <pre><code>Server -&gt; Client: FIN, ACK
  Client -&gt; Server: ACK
  Client -&gt; Server: FIN, ACK
  Server -&gt; Client: ACK
  </code></pre>
  <p>Does anyone have any suggestions?</p>