title: will a tcp program check missing packet before it passively closes a tcp connection after receiving a RST or FIN
body: <p>if there is a tcp connection between A and B, 
  A send some packets and then a TCP RST(or TCP FIN/ACK) to close the connection,
  let me say?</p>
  
  <pre><code>     PKT1, PKT2, PKT3, TCP_RST
  </code></pre>
  
  <p>or </p>
  
  <pre><code>     PKT1, PKT2, PKT3, TCP_FIN/ACK
  </code></pre>
  
  <p>but the packet arrival is out of order</p>
  
  <pre><code>    PKT1, TCP_RST(or TCP_FIN/ACK), PKT2, PKT3
  </code></pre>
  
  <p>then how will B react?</p>
  
  <p>according to the sequence number of TCP_RST and TCP_FIN/ACK,
  B knows there are some packets missing(PKT2 and PKT3), 
  will B wait for PKT2 and PKT3 before it close the connection, 
  or B immediately close the connection when it receives TCP_RST(or TCP_FIN/ACK)?</p>
  
  <p>thanks</p>