Hi, There's an error on the select() function:
int rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, struct timeval *timeout) { static struct timeval tv0; static HANDLE hEvent; HANDLE h, handle_array[FD_SETSIZE + 2]; fd_set handle_rfds, handle_wfds, handle_xfds; struct bitset rbits, wbits, xbits; unsigned char anyfds_in[FD_SETSIZE / CHAR_BIT]; DWORD ret, wait_timeout, nhandles, nsock, nbuffer; MSG msg; int i, fd, rc; if (nfds > FD_SETSIZE) nfds = FD_SETSIZE; if (!timeout) wait_timeout = INFINITE; else { wait_timeout = timeout->tv_sec + timeout->tv_usec / 1000; --- last line should be: wait_timeout = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; Regards. -- René Berber