如题,在实验UDP Socket 例程的时候,想读取接收到的数据进行解析。请问传输的数据存在哪里?
iStatus = sl_RecvFrom(iSockID, g_cBsdBuf, sTestBufLen, 0,
( SlSockAddr_t *)&sAddr, (SlSocklen_t*)&iAddrSize );
使用sl_RecvFrom 函数,数据是存在g_cBsdBuf 里吗?
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.
sAddr.sin_family = SL_AF_INET;
sAddr.sin_port = sl_Htons((unsigned short)iPort);
sAddr.sin_addr.s_addr = sl_Htonl((unsigned int)iStaticIp);
iAddrSize = sizeof(SlSockAddrIn_t);
iDataLen = sl_RecvFrom(iHandle, pDataBuffer, sizeof(pDataBuffer), 0,( SlSockAddr_t *)&sAddr, (SlSocklen_t*)&iAddrSize );
pDataBuffer为接收数据缓存,接收的数据放到该数组中,一般使用指针的形式,直接将数据存储到对应的RAM中