#include <errno.h>
#include <time.h>
+#include <string.h>
+#include <stdio.h>
#ifdef WIN32
+#ifdef _WIN32_WINNT
+#undef _WIN32_WINNT
+#endif
#define _WIN32_WINNT 0x501
-#include <windows.h>
#include <winsock2.h>
-#else
-#include <string.h>
-#include <stdio.h>
+#include <windows.h>
+#elif defined HAVE_SYS_SELECT_H
+#include <sys/select.h>
#endif
/* compat */
continue;
if(iosock->fd > fds_size)
fds_size = iosock->fd;
- FD_SET(iosock->fd, &read_fds);
select_result++;
+ if(iosocket_wants_reads(iosock))
+ FD_SET(iosock->fd, &read_fds);
if(iosocket_wants_writes(iosock))
FD_SET(iosock->fd, &write_fds);
}