I am writing some simple client/server code using UDP. The program works fine, but if I only start the client, the recvfrom method does not block. However, when I remove the sendto method, recvfrom starts to block. Any idea of what is going on?
Let me try to understand and maybe just a guess. When you do a sendto(..) you send data to some place and that some place will send a response back to you correct? Then you do a recvfrom and you get that response and it moves along.
Now if you remove sendto(..) and straight go to recvfrom, are there any response going to come in? If no then it block isn't it ? I don't know if you have explored any non-blocking API besides recvfrom?