the SOCKET type is unsigned on Windows, and should be casted to an int before comparing with the highestfd variable (note: ``int highestfd = -1;'') From /dev/humancontroller.