Network/TcpClient: Revert to previous behavior on failure

This commit is contained in:
Lynix 2018-10-01 23:05:14 +02:00
parent 67c56b2aba
commit aa9bec6e5e
2 changed files with 4 additions and 2 deletions

View File

@ -147,7 +147,6 @@ Nazara Engine:
- ⚠️ CullingList now handles full and partial visibility testing
- Added math class Angle, capable of handling both degrees and radians angles and converting them to euler angles/quaternions to improve 2D interface.
- ⚠️ AbstractSocket::OnStateChange has been replaced by OnStateChanged, which is now called after state has been changed (with oldState and newState as parameters).
- ⚠️ TcpClient::WaitForconnected now closes the socket on failure.
- ⚠️ TcpClient::WaitForconnected now returns the new socket state.
- Added TcpClient::PollForConnected

View File

@ -502,7 +502,10 @@ namespace Nz
// Prevent valid stats in non-connected state
if (newState == SocketState_NotConnected)
Close();
{
m_openMode = OpenMode_NotOpen;
m_peerAddress = IpAddress::Invalid;
}
UpdateState(newState);
return newState;