My program is the client, the MFC to write, when the program exits with PostQuiteMessage (1), but forget to call the client socket before exit the close () function, there is no call destructor, no release resources, withdrew,
Excuse me:
1, the operating system will help the close? Delay mechanism?
2, the service side how to deal with over there? Delay mechanism?
CodePudding user response:
1. The process exits, system recovery socket.2. The service side usually customer immediately disconnected, but there are not immediately know, will be through the heartbeat mechanism check connection timeout, overtime as disconnected,