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
narlapavan
0
Newbie Poster
Recommended Answers
Jump to PostIn 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 …
Jump to Postcan you share the code segment for both the sender and receiver programs where you are making the communication, also mention which compiler you are using and which platform(windows or Linux)
All 5 Replies
dkalita
110
Posting Pro in Training
narlapavan
0
Newbie Poster
dkalita
110
Posting Pro in Training
narlapavan
0
Newbie Poster
dkalita
110
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.