Network/UdpSocket: Fix UdpSocket::Receive failing when peers suddenly closes its socket

This commit is contained in:
Lynix 2017-01-27 15:08:26 +01:00
parent d8b7ff9fa6
commit 3489421064
1 changed files with 12 additions and 1 deletions

View File

@ -93,7 +93,18 @@ namespace Nz
int read;
if (!SocketImpl::ReceiveFrom(m_handle, buffer, static_cast<int>(size), from, &read, &m_lastError))
return false;
{
switch (m_lastError)
{
case SocketError_ConnectionClosed:
m_lastError = SocketError_NoError;
read = 0;
break;
default:
return false;
}
}
if (received)
*received = read;