Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UDP recvfrom question

Status
Not open for further replies.

zsfhaergta

Programmer
Oct 6, 2008
26
US
Hi,

I am developing the client end of a program. I receive data from at most two channels at a time. While I am currently recvfrom() and processing the data from one channel, I call recvfrom() and queue the data from the other channel. At times this runs correctly. Other times, it seems that recvfrom() doesn't see any data coming from the network. I have tried the block and non-blocking methods, but neither of them return with data. Besides waiting for data to appear on the network, is there any other reason why the recvfrom() function would block or return nothing(for nonblocking)?

Thanks,
Allen
 
recvfrom() should return -1 when set to non-blocking when called and no data is available.

Otherwise it blocks until data is received. So there is your dilemma . You must write code to handle the limitations of the function library while dealing with the requirements of the network, it's applications and your application.

Incidentally, this is defiantly a software programming question. I don't think you'll get the best response here. Maybe try the C programming area or General UNIX discussion.

Amiel Summers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top