Please help:program hang stuck there signal handling on POSIX Message Queue UNIX C pr
in a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism , can ignore the priority and other linked list message,to implement the scenario:
|
I must say I have a hard time understanding why you are continuously opening and closing the message queue. Perhaps inefficiency is a vague concept to you.
I wrote a simpler program, albeit without the signal handling capabilities that you have in your program. Perhaps you can glean some ideas from this little app: Code:
#define _XOPEN_SOURCE 600 /* for mq_timedreceive() */ P.S. Normally I would not combine the client and server code into one source file. I would normally implement these in separate files, and create two executables. |
All times are GMT -5. The time now is 12:19 PM. |