sendto_kdc.c start_connection(...) calls socket(...). The returned SOCKET is treated as a file handle. On Windows, the SOCKET is greater than FD_SETSIZE, so close is called. The SOCKET is also greater than the number of file handles, so close asserts.