• Advertisement
Sign in to follow this  

Does select() work on connection-less UDP sockets?

This topic is 4726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does select() work on connection-less UDP sockets? My initial experiments failed - I had a 5 second wait on the select, but when I sent some data from the client, nothing happened. the select() call returned 0. I'm presuming this is possible, but I'm not sure what I'm doing wrong. Thanks

Share this post


Link to post
Share on other sites
Advertisement
I just tried again, and when I run my server I get a return value of 1 from select(), without sending anything from the client. Weird.

Google, where are ya???

Share this post


Link to post
Share on other sites
It should work. Have you tried just using a blocking recv instead?

Share this post


Link to post
Share on other sites
Yeah I passed in all three masks - I'm getting a write action for the socket, whic h is weird as I'm not writing anything to it.

THanks

Share this post


Link to post
Share on other sites
Quote:
Original post by stodge
Yeah I passed in all three masks - I'm getting a write action for the socket, whic h is weird as I'm not writing anything to it.
Select notifies you when the socket is ready for writing (i.e. the output buffer isn't full), not when something has been written to it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement