Network/TcpClient: WaitForConnected now closes the socket on failure

This commit is contained in:
Lynix
2018-10-01 22:19:49 +02:00
parent f6b0405f9b
commit 13a515c1b5
2 changed files with 3 additions and 2 deletions

View File

@@ -467,9 +467,9 @@ namespace Nz
SocketState newState = SocketImpl::Connect(m_handle, m_peerAddress, msTimeout, &m_lastError);
NazaraAssert(newState != SocketState_Connecting, "Invalid internal return"); //< Connect cannot return Connecting is a timeout was specified
// Prevent valid peer address in non-connected state
// Prevent valid stats in non-connected state
if (newState == SocketState_NotConnected)
m_peerAddress = IpAddress::Invalid;
Close();
UpdateState(newState);
return newState == SocketState_Connected;