i would like to know, is there any method to flush all messages which are pipelined on 1 msgQId?????
Asked
Active
Viewed 1,641 times
1 Answers
3
There is no built-in API to flush all messages from a message queue.
If all you want to do is discard all messages from a queue, here is a quick way to do this:
void discardQMessages(MSG_Q_ID id) {
while(
msgQReceive(id, NULL, 0, NO_WAIT) != ERROR
) ;
if {errno != S_objLib_OBJ_UNAVAILABLE)
/* Uh oh... got some problem */
}
You should always check errno when you get error from any OS API call.

Benoit
- 37,894
- 24
- 81
- 116
-
thnx for ur information. i was also thinking in this way only. – Pratik Jul 30 '12 at 03:03