iPhone does not receive UDP data over WiFi
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);
精彩评论