|
The client derives its own class from CAsyncSocket and overrides the OnReceive function. The server will send out a disconnection detection packet at regular intervals. The client discards the packet. But when the client needs to wait for the server to return data, I use WaitForSingleObject to wait for the event. This event sets a signal state after receiving data in this class. The problem is that it seems that data cannot be received after using WaitForSingleObject (do not call OnReceive). As a result, the program cannot correctly get the data sent by the server. Is there any way to solve it? |
|