This needs to replaced with: `if (sock == HTTP_INVALID_SOCKET)` I hope that no one has written this yet and that I have overlooked it ;)