I am porting some code from BSD sockets to Winsock, and I'm not sure how to handle this case below.
In my source application, the choice is made for both stdin and the network socket:
FD_SET(sock, &fd);
FD_SET(0, &fd);
...
if (select(..., &fd, ... )...)
Trying to run this on Winsock gives error 10038 (WSAENOTSOCK), which makes sense, because what was file descriptor 0 on Linux (stdin) is not a socket (more precisely: the SOCKET type) on Windows.
Is there an easy way to port this test to windows sockets?
source
share