我用httplistenter做了一个http的服务端,接受一个远程设备发送的数据,并根据结果给其返回相应数据。返回数据代码如下:
HttpListenerContext ctx = httpListener.GetContext();
string result = "+IPDA3810DE1F4E7D";
byte[] buffer = Encoding.ASCII.GetBytes(result);
ms.Write(buffer, 0, buffer.Length);
ms.Flush(); ms.Close();
ctx.Response.Close();
但是远程设备接收到的数据会在返回的result字符的前面和后面会有其他的字符和换行存在。这应该是哪里产生的问题呢?