UDP Block?

Hey guys, I need people to guess the solution: (.

I am using UDP sockets and what I am doing is sending the player input which is around 8, 4, or any bytes. I am using recvfrom and sendto. It runs for a few minutes and then randomly blocks. However, it might be related to my application logic, but I want to know if anyone has any experience with this and this is a UDP / Networking issue. My code is here http://www.pastie.org/486583 , but I basically want to know what I can study to fix this issue based on your impressions.

+1


a source to share


4 answers


Use Wireshark to figure out which side is down.

Is the sender sending?



Or is the receiver not receiving?

+2


a source


Does the GetInput () function expect sendTo and recvFrom to always complete? UDP does not guarantee that your messages will be sent or received, or in what order the messages will arrive. I think your timeouts are also set to infinity, so that happens from time to time, the message fails and you can wait indefinitely for a message that is already lost.



0


a source


What does "blocking" mean?

Note that the network is allowed to lose (drop) UDP packets: your protocol must allow some to be lost from time to time, or ready to be retransmitted.

0


a source


What is locked means, and who is locked. You have not checked the return values ​​of the "recvfrom" and "sendto" system calls. Have you tried running Wireshark to observe the behavior.

0


a source







All Articles