quote:Original post by granat
Messy ? Why ?
Non-blocking sockets are almost never necessary, and a good thing, too: their lack of performance makes them a poor architecture choice.
When a socket is set as non-blocking, every Winsock call on that socket will return immediately, whether it was able to do anything or not. This is useful because it lets your program do other things while the network is busy. The problem is, sometimes the program doesn't have anything to do. This leads to a commonly-seen construct that might be called "spin until the network becomes ready".
About the only time you should use non-blocking sockets and/or select() is when you are porting BSD sockets code to Winsock or when your code must also work under BSD sockets. In all other cases, there are better alternatives.
------
GameDev'er 4 ever.
[edited by - Khelz on June 21, 2002 9:42:39 AM]