Socket tcp c# how to clear input buffer?

后端 未结 2 1659
不知归路
不知归路 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条回答
  •  清酒与你
    2021-01-25 08:16

    The main question was **how to clear the input buffer? ** or am I wrong?=!

    Nevertheless; since you don't have a fixed buffer denoted as seen from you posted code and receive it via the SocketAsyncEventArgs, you could clear it with:

    Array.Clear(e.Buffer, 0, e.Buffer.Length);
    

提交回复
热议问题