I know that when a process crashed, existing TCP socket would be abandoned by sending RST packet(segment) to other peer, and relevant socket fd on other peer would receive the RST packet.
Is there other cases that RST packet sent out?
Such as if a process call close() on a socket fd but with unread data left on that socket, would it also send RST packet(segment) over that socket fd to other peer?
Quoting the TCP/IP Guide
If you observe strange
RSTbehaviours you may be the victim of a TCP Reset AttackAbout your last question, i guess no
RSTis sent out when you close a socket with unread data into socket buffer because it will not break any TCP rule (packets were delivered correctly, it’s just the process who didn’t elaborate it). Instead aFINwill be sent.