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.

CC3200 UDP收发问题

Other Parts Discussed in Thread: CC3200

iSockID = sl_Socket(SL_AF_INET,SL_SOCK_DGRAM, 0);

sl_Bind(iSockID, (SlSockAddr_t *)&sLocalAddr, iAddrSize);

iStatus = sl_SendTo(iSockID, g_cBsdBuf, sTestBufLen, 0,                 //发送数据

(SlSockAddr_t *)&sAddr, iAddrSize);

iStatus = sl_RecvFrom(iSockID, g_cBsdBuf, sTestBufLen, 0,          //接收反馈
( SlSockAddr_t *)&sAddr, (SlSocklen_t*)&iAddrSize );

程序意图是用同一个socket,进行收发,先发送命令,再接收返回数据,

同一个socket发送可以,接收失败。(为什么同一个socket不行????????)

用两个socket,一个负责发送,一个负责接收,收发都成功,