#GetNoMsg() ?
5 messages in this thread
Ok.. what's the safest/best way to check if a message is waiting at a port
without actualPly retrieving that message with GetMsg() ?
Khalid.
Khalid,
Humm…is there something wrong with WaitPort() ?
I realize that you can get a return from it, yet there be no
message waiting (is that a "feature"????)…but as far as I know, without
messing with the exec structures…that's the safest.
Don
But if there's no message, then your prog. will wait for one to arrive…
maybe not what Khalid wants… I'd try either wait with a timer signal
also so If There wasn't a msg in 1/50 s I would be done waiting. Another
thing to try would be to do a GetMsg, then reply it to the same port you
got it from, rather than the real reply port.
s
Khalid, how about…
struct Message *
PollGetMsg(msgport)
{
if (!msgport->mp_MsgList.lh_Head->ln_Succ)
return(Remove(msgport->mp_MsgList.lh_Head));
else
return(NULL);
}
This might not be exactly right, but I got the idea from "Lists and Queues"
in the Exec manual.
Ariel
Ariel, hmm… looks like it might work… I'll play with that.. thanks!
Khalid.