CompuServe Thread

#GetNoMsg() ?

5 messages in this thread
#118349From: Khalid AldoseriAug 30, 1990 5:58 PM
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.
#118371From: Don Curtis/SYSOPAug 30, 1990 10:09 PM
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
#118437From: Matthew J. W. RatcliffAug 31, 1990 12:14 PM
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
#118730From: Ariel ButlerSep 2, 1990 1:57 PM
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
#118848From: Khalid AldoseriSep 3, 1990 2:17 AM
Ariel, hmm… looks like it might work… I'll play with that.. thanks! Khalid.