This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NDK API库里send函数,能保证每次指定大小的数据完成发送吗?



问题现象:

     让这样一个程序段每隔1毫秒执行一次,发送682次。PC机用一个界面接收数据,发现接收到的数据总量为21364B。发送的数据位32位的累加数,接收到的数据连续,应该是没有丢掉中间的数据。所以可以根据内容计算接收到的数据量。

理论发送数据量为32B*682=21824B。而实际接收到21364B,计算应该对应667次发送多20B,这就意味着最后的几次发送没执行,并且接收到的最后一次没有完成该次全部数据的发送。这是什么问题呢?

btscl = send( s, (char*)(0x0c130000+cnttscl1*32), 32, 0 ); 

cnttscl1= cnttscl1+1;

whilebtscl !=16 ); //--如果出错,死循环

注:程序基于ccs安装包的client修改。

 

PS:这样机制开发的以太网,一般的实际速度能到多大?!