1. need add definition `_WIN32_WINNT` for your window version (at leat 0x0600, or will not have `WSAPoll`) 2. might need define `WIN32_LEAN_AND_MEAN` (not affected here, but might affect other places) 3. get `errno` in the Windows socket world should use `WSAGetLastError` 4. `connect` in non blocking mode will always return -1 and set errno `WSAEWOULDBLOCK`. I commented the `SetNonBlock` before the `connect`s. 5. a bug in gcc8 (at least fixed in gcc10), in the declaration of WSAPoll, a `const void *` signature missed `const`, neet add const_cast for fix