There are some other fun edge cases - for example:
- If you have a port-forward to a machine that is switched off then you can get ICMP network unreachable or ICMP host unreachable as the response to the a SYN in the initial handshake.
This can also happen at any point in the connection. Other ICMP messages can also occur like this (eg. admin prohibited).
It's always worth remembering that the TCP connection is sitting on an underlying network stack that can also signal errors outside of the TCP protocol itself.
- If you have a port-forward to a machine that is switched off then you can get ICMP network unreachable or ICMP host unreachable as the response to the a SYN in the initial handshake.
This can also happen at any point in the connection. Other ICMP messages can also occur like this (eg. admin prohibited).
It's always worth remembering that the TCP connection is sitting on an underlying network stack that can also signal errors outside of the TCP protocol itself.