Non-blocking sockets

Started by
1 comment, last by drslush 20 years, 10 months ago
I am trying to make a program that uses sockets and can check if data has been recieved. Currently I''m just using recv() with MSG_PEEK to see if there is data, but this blocks the thread. I know its possible to make a non-blocking socket with Winsock 2 (I''m looking into overlapping sockets). Is this possible to do in Winsock 1.1?
Advertisement
SOCKET s = socket(...);
long nonblock = 1;
ioctlsocket(s, FIONBIO, &nonblock);
Yes, winsock 1.1 supports OVERLAPPED non-blocking I/O.

Kuphryn

This topic is closed to new replies.

Advertisement