Home > Back-end >  CAsyncSocket cannot reconnection after the client disconnects
CAsyncSocket cannot reconnection after the client disconnects

Time:11-11

The client and the server is done with the CAsyncSocket derived classes, the client is a dialog-based application, Connect to a TCP server, send and receive all normal (client, server-side), if midway broken network (client while trigger), network back to normal after a few seconds, the server will accept less than the client's message, the client calls the Connect method, the client will sometimes prompt socket error, the server doesn't have any reaction,

Everyone help to see what this is about, how to solve, thank you!

CodePudding user response:

Break line reconnection socket, you need to call closesocket closed, and then generate a new socket to connect to the server
Break the CAsyncSocket, if, you need to close the socket, to generate a new socket, to connect

CodePudding user response:

Yes, disconnect, you need to link,

CodePudding user response:

I also encountered the same problem, close to 2 times after the client connection,
  • Related