17. Inter-process communications: messages
Make 17_IPC2 directory and store code there.
Use lecture examples
Wrirte a program sendmq.c that sends a message with priority 1 through the specified queue
./sendmq /queue Message should send a message "Message" to queue "/queue" with priority 1
- You may also copy+paste and test other lecture examples:
- queue creation
- message receiving
- queue unlinking
Write a «messaging server» mqserver.c that constantly waits on message queue and prints every message received.
- Create a queue
- Wait for the message and receive it
If this message is not equal to string "QUIT" (i. e. 5 bytes: 'Q', 'U', 'I', 'T' and 0), then print it, and go to (2.)
Stop receiving and unlink the queue if message is string "QUIT"
Modify server to catch SIGINT. Call resulting program mqsignal.c
so when pressing Control+C the program should stop reading messages, unlink the queue and stop
- check every function called for possible errors
H/W
- Finish all tasks