fix(net): Fix TCP Unresponsiveness and Inability to Close Connections (#791)

* fix(net): Improve stability. 为RawSocket与UdpSocket实现close时调用close方法,符合smoltcp的行为。为SocketInode实现drop,保证程序任何情况下退出时都能正确close对应socket, 释放被占用的端口。

* fix(net): Correct socket close behavior.
This commit is contained in:
Samuel Dai
2024-05-11 17:17:43 +08:00
committed by GitHub
parent b941261d94
commit 37cef00bb4
4 changed files with 143 additions and 134 deletions

View File

@ -233,6 +233,8 @@ int main(int argc, char const *argv[])
// 关闭客户端连接
close(new_socket);
}
// 关闭tcp socket
close(server_fd);
return 0;
}