added parallel message receiving for previously implemented messaging where necessary
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user