返回信息流我的程序流程:
PC机与DM642开发板相连。
PC机流程:SOCKETàBINDà有数则收,有键盘输入则发送数据;
DM642流程:SOCKETàBINDà接收数据à收到数据则发送
上述为可以正常工作的流程,DM642在收到数据后,再发送,则可以一直发送成功,并且PC机端可以收到。但是上边流程去掉接收数据部分,DM642端也会报发送数据成功,但是PC机端并未收到数据。PC机的程序是正常的。我们用一个网络监视工具监视,发现当DM642没有接收数据这个环节时,发送数据,网络监视工具显示一次DM642 的ARP request,PC机的ARP response后,再发送也没有别的消息。
能帮我分析一下问题出在哪里吗,麻烦各位了
这是一条镜像帖。来源:北邮人论坛 / embedded-system / #10006同步于 2010/12/19
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Embedded_System机器人发帖
ndk udp问题
mayiie
2010/12/19镜像同步4 回复
订阅后,新回复会通过你的通知中心匿名送达。
4 条回复
当初看过的一点儿资料
3、pbm.c中的注释:The number of buffers in the free pool can have a significant effect on performance, especially in UDP packet loss. Increasing this number will increase the size of the static packet pool use for both sending and receiving packets.
文档中也提到了UDP发送时丢包的处理方法:
UDP application drops packets on send() calls.
If sending to a new IP address, the very first send may be held up in the ARP layer while the stack determines the MAC address for the packet destination. While in this mode, subsequent sends will be discarded.
When using UDP and sending multiple packets at once, make sure you have plenty of packet buffers available (see section 7.3.1).
Verify you don’t have any scheduling issues. Try running the scheduler in high priority (via NC_SystemOpen()).
谢谢你的回复,受到启发了,你的资料是ndk的datasheet吗?项目比较急没有细看过那些datasheet....
tasksleep最小单位是1ms,对于我的应用来说,时间有点长,协议栈完成发送有没有其他标志,或者有没有其他时间短一些sleep函数[em68]