|
My idea is to display the message on the server after receiving the message from the client
= There is no problem at all, just asynchronous reception
Then immediately send a message from the server to the client
= Here comes the problem: sending messages is fine, but how do you know the status of the client? In other words, how do you know that the client is ready to receive?
Two sub-threads should be used, one is used to monitor and accept client connection requests, and add these requests to a list; the other thread keeps running Socket.Select to filter the Socket in the list to determine the status of the client, which is waiting Receive or wait to send. Then, use asynchronous receiving or sending to process the client's request. |
|