本文介绍了接收3144字节TCP / IP套接字在调试模式期间,但在执行1024字节期间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过TCP / IP套接字接收3144字节在调试模式期间,但在执行期间收到1024字节

为什么会发生


IPEndPoint ipEnd = new IPEndPoint(ipAdd,ipPort);

套接字套接字=新套接字(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);


套接字。连接(ipEnd);

byte [] sendData = Encoding.ASCII.GetBytes(" msg");

socket.Send(sendData);


int byteLen = 4096;

byte [] RecData = new byte [byteLen];

DataLen = socket.Receive(RecData,0,RecData .Length,SocketFlags.None);

I am Receiving 3144 bytes through TCP/IP socket During debug mode, but during excecution 1024 byte were received
Why it is happen

IPEndPoint ipEnd = new IPEndPoint(ipAdd, ipPort);
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

socket.Connect(ipEnd);
byte[] sendData = Encoding.ASCII.GetBytes("msg");
socket.Send(sendData);

int byteLen = 4096;
byte[] RecData = new byte[byteLen];
DataLen = socket.Receive(RecData, 0, RecData.Length, SocketFlags.None);

推荐答案

展开 | 选择 | Wrap | 行号




这篇关于接收3144字节TCP / IP套接字在调试模式期间,但在执行1024字节期间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 16:55