Advertisement Jump to content
Sign in to follow this  
Shock

Non-Blocking Sockets in Linux

This topic is 4906 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 all, How do you set a socket to non-blocking/blocking status in linux? In win32 I used ioctlsocket(...), what is the linux equivalent of this? Thank You!

Share this post


Link to post
Share on other sites
Advertisement
Threading brings with it all the synchronisation issues however, not to mention isn't as scalable. The latter may not often be a problem but the former may be.

Share this post


Link to post
Share on other sites
The HTTP GET sample runs on Windows and Linux, and uses non-blocking sockets. It contains a header (sock_port.h) which makes socket programming more portable.

The specific strategy used on Linux is to not change the socket, but instead pass the MSG_DONTWAIT flag. Anyway, if you're doing Linux and Windows programming, you might want to look at that sample.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!