first i am creating socket, with that socket descriptor i am sending some no. of bytes through sendto(....) function.
At the time of receiving through recvfrom(....) function, my code was hanging if the specified destination address is not available. Suppose if destination is available the it's working correctly... Why this is happening
Jump to Post
In the recvfrom() function, use "MSG_DONTWAIT" flag in the 4th argument(which is the flag) and see whether it solves your problem.
By default, the method will wait until it gets a message from the mentioned address, and your program will proceed only after that.
Read the manual …
All 5 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.