Original Post
🔒 Locked
I need a non-blocking socket tutorial.
Advertisement
You could try to look at the "select" function. Or use multithreading (that''s what I did at first, but I''m trying to figure out how to implement select in my program).
"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said

http://druidgames.cjb.net/
"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said

http://druidgames.cjb.net/
select is async...and multithreading might be an unessesary step. Check out fcntl(). And also, there is no reason at all why you cant use async in a console app. While windows apps use WSAAsyncSelect(), a console app can implement the BSD select() call just like in a *nix app.
Here''s a function you can use to toggle a SOCKET between blocking and non-blocking mode.
// CHRIS
|
// CHRIS
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement