added parallel message receiving for previously implemented messaging where necessary

This commit is contained in:
2026-01-30 18:28:19 -08:00
parent 448db1e0e3
commit a965dff4ca
4 changed files with 28 additions and 29 deletions

View File

@@ -229,6 +229,18 @@ static int waitForAllMessage(int numClients, const char* expectedMessage) {
return 1;
}
// Wait for ACK:TARGET from ALL clients simultaneously
// Returns 1 if all clients acknowledged, 0 otherwise
int waitForAllTargetAck(int numClients) {
return waitForAllMessage(numClients, "ACK:TARGET");
}
// Wait for READY from ALL clients simultaneously
// Returns 1 if all clients are ready, 0 otherwise
int waitForAllReady(int numClients) {
return waitForAllMessage(numClients, "READY");
}
// Wait for RTL_COMPLETE from ALL clients simultaneously
// Returns 1 if all clients completed RTL, 0 otherwise
int waitForAllRTLComplete(int numClients) {

View File

@@ -18,11 +18,15 @@ int receiveTargetAck(int clientId);
int waitForReady(int clientId);
void sendFinished(int clientId);
// Parallel wait functions (using select() for simultaneous processing)
int waitForAllTargetAck(int numClients);
int waitForAllReady(int numClients);
int waitForAllRTLComplete(int numClients);
int waitForAllLANDComplete(int numClients);
// RTL and LAND protocol functions
void sendRTL(int clientId);
void sendLAND(int clientId);
int waitForAllRTLComplete(int numClients);
int waitForAllLANDComplete(int numClients);
void waitForUserInput();
#ifdef __cplusplus