FIXTradingCommunity / fixp-specification

FIXP - FIX performance session layer specification
Other
49 stars 17 forks source link

[04PointToPointSessionProtocol.md] "Terminate Session Sequence Diagrams" improvement #39

Closed ujos closed 6 years ago

ujos commented 7 years ago

Upon receiving Terminate message, acceptor of Terminate should not wait for TCP FIN message from initiator. It can send TCP FIN just after Terminate message. So sequence will be following:

Initiator

  1. Send Terminate
  2. Wait for Terminate acknowledge
  3. Close socket

Acceptor:

  1. Receive Terminate
  2. Send Terminate
  3. Shutdown socket (send TCP FIN message)
  4. Close socket

Does it make sense?

donmendelson commented 7 years ago

Agreed but there may be a race condition in which side closes the TCP connection first.

adkapur commented 6 years ago

Why don't we just leave it up to the initiator to send the TCP FIN message first? If the acceptor sends the TCP FIN first for some reason and it gets ACK from initiator then acceptor will close connection and not be able to send ACK in response to TCP FIN from initiator

Assuming that Terminate response has been sent by acceptor then:

Acceptor sends TCP FIN Initiator sends ACK Acceptor has closed connection Initiator sends TCP FIN

ujos commented 6 years ago

If the acceptor sends the TCP FIN first for some reason and it gets ACK from initiator

Which ACK?