前提:应用程序已经建立的tcp socket,然后程序发生退出exit;
这个时候会发tcp reset消息出去吗?
根据chatGPT的回复是,只有在设置了linger之后,才会发送reset消息。
https://www.man7.org/linux/man-pages/man7/socket.7.html
SO_LINGER
Sets or gets the SO_LINGER option. The argument is a
linger structure.
struct linger {
int l_onoff; /* linger active */