Jump to content
  • Advertisement
Sign in to follow this  
Jary

Equivalent of poll() in Winsock ?

This topic is 4235 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

Hello, I'm writting a program with sockets, I am actually recieving data, with select, (I have more than one socket). I would like to use POLLOUT and poll() to check which socket is less busy, to use it to send data, or split between the different sockets. But when I try to compile in VC++, (using winsock2.h) it doesn't find poll() and pollout. I don't have either sys/poll.h. I'm wondering if there is an equivalent of poll() / pollout in the Winsock2.h, otherwise if it is possible to get poll.h, or if there is another way to check for the socket which is the less busy (ready to send data). I thank you a lot in advance. Jary

Share this post


Link to post
Share on other sites
Advertisement
Windows does not have the poll() system call. You can get the amount of queued data on a socket by using ioctlsocket() on Windows.

Share this post


Link to post
Share on other sites
Thanks.

Just wondering, MSG_DONTWAIT doesn't work with windows ? It says "identifier not declared" :-(

Share this post


Link to post
Share on other sites
Been using select() to recieve data, it works fine with FD_ISSET. Thanks :-)

Now i'm wondering how to check if the sending buffer is empty or not (busy or not), or well look for all the buffer, and define which one is empty (busy).
I found only MSG_DONTWAIT but it's for Unix, and I can't find any equivalent for winsocks :/ Is select() also right for choosing sockets to send data with please ?

Thanks for help again !

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!