开发者

iPhone does not receive UDP data over WiFi

开发者 https://www.devze.com 2023-01-18 21:49 出处:网络
With a WiFi connection, UDP data is not received. It开发者_Python百科 stops at: recvfrom(sock, buf, RECV_BUF_SIZE, 0, (SOCKADDR*)&rAddr, (SOCK_LEN*)&len);

With a WiFi connection, UDP data is not received. It开发者_Python百科 stops at:

recvfrom(sock, buf, RECV_BUF_SIZE, 0, (SOCKADDR*)&rAddr, (SOCK_LEN*)&len);

When I run the same program in iPhone simulator over ethernet it works well. What am I missing?


Look at the man page.

Like so:

  recvfrom(mSock,recvBuff,1024,0,(struct sockaddr *)&from, &fromlen);

providing the parameter values you are setting are correct try this in your case try:

  recvfrom(sock, buf, RECV_BUF_SIZE, 0, (struct sockaddr *)&rAddr, &len);
0

精彩评论

暂无评论...
验证码 换一张
取 消