simplify
This commit is contained in:
@@ -227,19 +227,15 @@ int NetworkStream_Win32::WaitForCompletionOrCancellation( int iEvent )
|
||||
m_Mutex.Unlock();
|
||||
|
||||
/* If the event didn't actually occur, keep waiting. */
|
||||
if( !(events.lNetworkEvents & (1<<iEvent)) )
|
||||
{
|
||||
/* If the socket was closed while we were waiting, stop. Note that when the
|
||||
* connection closes immediately after sending data, we'll receive both this
|
||||
* message and FD_READ at the same time. Only do this if the event we really
|
||||
* want hasn't happened yet. */
|
||||
if( (events.lNetworkEvents & (1<<FD_CLOSE_BIT)) )
|
||||
return WSAECONNRESET;
|
||||
if( (events.lNetworkEvents & (1<<iEvent)) )
|
||||
return events.iErrorCode[iEvent];
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
return events.iErrorCode[iEvent];
|
||||
/* If the socket was closed while we were waiting, stop. Note that when the
|
||||
* connection closes immediately after sending data, we'll receive both this
|
||||
* message and FD_READ at the same time. Only do this if the event we really
|
||||
* want hasn't happened yet. */
|
||||
if( (events.lNetworkEvents & (1<<FD_CLOSE_BIT)) )
|
||||
return WSAECONNRESET;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user