Socket tcp c# how to clear input buffer?

后端 未结 2 1682
不知归路
不知归路 2021-01-25 07:27

I\'m writing an application for windows phone and I need to communicate with a server and transmit data. The SERVER is written in C++ and I cannot modify it. The CLIENT is what

2条回答
  •  Happy的楠姐
    2021-01-25 08:19

    oleksii is right, you should call client.Receive() in a loop. You can choose to start a thread that covers the receive section of your code. Also note that client.Receive() will keep trying to receive from the buffer, and it will get stuck if there is no data available.

提交回复
热议问题