title: FIN,ACK after PSH,ACK
body: <p>I'm trying to implement a communication between a legacy system and a Linux system but I constantly get one of the following scenarios:</p>
  
  <p>(The legacy system is server, the Linux is client)</p>
  
  <pre><code>Function recv(2) returns 0 (the peer has performed an orderly shutdown.)
  &gt; SYN
  &lt; SYN, ACK
  &gt; ACK
  &lt; PSH, ACK  (the data)
  &gt; FIN, ACK
  &lt; ACK
  &gt; RST
  &lt; FIN, ACK
  &gt; RST
  &gt; RST
  
  Function connect(2) returns -1 (error)
  &gt; SYN
  &lt; RST, ACK
  </code></pre>
  
  <p>When the server have send its data, the client should answer with data, but instead I get a "FIN, ACK"
  Why is it like this? How should I interpret this? I'm not that familiar with TCP at this level</p>