Created
April 24, 2018 20:14
-
-
Save aleqsio/7a09c59730cf3bd09f5282c2cb1fcf43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (serverRunning) { | |
CHECK_IS_POSITIVE(msgrcv(publicServerQueueID, &readMessage, MESSAGE_SIZE, 0, 0)); | |
runCommand(&readMessage); | |
} | |
struct msqid_ds queueState; | |
CHECK_IS_POSITIVE_ERROR(msgctl(publicServerQueueID, IPC_STAT, &queueState),"er0"); | |
while (queueState.msg_qnum) { | |
CHECK_IS_POSITIVE_ERROR(msgctl(publicServerQueueID, IPC_STAT, &queueState),"ER1"); | |
CHECK_FALSE(msgrcv(publicServerQueueID, &readMessage, MESSAGE_SIZE, 0, 0)<0,"Failed to read remaining commands"); | |
runCommand(&readMessage); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment