disable KeepAlive flag in CloseConnectionSocket to close hanging keep-alive connections
When there are hanging keep-alive sockets, they don't get closed with CloseSocket()
. It is necessary to set the connection KeepAlive flag to False to exit the keep-alive loop. Otherwise the program hangs in the loop for ever.