if (connect(m_sock, reinterpret_cast<PSOCKADDR>(&m_addr), m_addr.GetSize()) == SOCKET_ERROR) { int error = WSAGetLastError();
// If something went wrong, the client will wait one second to connect the server again. // Of course, it will clear and setting up everything again. if (error != WSAEWOULDBLOCK) { Sleep(1000); Clear(); m_sock = socket(AF_INET, SOCK_STREAM, 0); if (m_sock == INVALID_SOCKET) { Clear(); OnConnectFailure(); return false;