return to while

This commit is contained in:
2025-04-17 18:40:18 -05:00
parent 5c32a86674
commit 24ab4a2f49
2 changed files with 5 additions and 9 deletions

View File

@@ -125,19 +125,16 @@ bool ClientModule::onEvent(const Archimedes::Event& event) {
void ClientModule::pollIncomingData() {
int numMsgs;
do {
while(running) {
ISteamNetworkingMessage *pIncomingMsg = nullptr;
numMsgs = interface->ReceiveMessagesOnConnection( connection, &pIncomingMsg, 1 );
int numMsgs = interface->ReceiveMessagesOnConnection( connection, &pIncomingMsg, 1 );
if ( numMsgs == 0 )
return;
break;
if ( numMsgs < 0 )
std::cerr << "Error checking for messages" << std::endl;
assert( numMsgs == 1 && pIncomingMsg );
assert( pIncomingMsg->m_conn == connection );
app->emitEvent(new CMEvent::DataRecievedEvent(pIncomingMsg));
//numMsgs--;
return;
} while (numMsgs > 0);
}
}