|
Hi all,
We have some code that listens on a takedescriptor and want to put a timeout on it. If the timeout is reached then we'll can the job.
I tried:
alarm(seconds);
sd = takedescriptor(*null);
alarm(0);
But takedescriptor blocks!
The handler procedure set for alarm isn't called when the time runs out. Once the timeout has occurred nothing happens. If I pass a descriptor after this timeout period takedescriptor completes and the handler procedure is THEN called. So SIGALRM is being blocked by takedescriptor until it completes.
Any of you guys/gals have an alternative solution? I know other signals can not be blocked but I need a timer-based solution so a call to kill wont do it. Also, I can't replace takedescriptor with rcvmsg because other processes are using givedescriptor, not sndmsg.
Any and all help is welcome.
Cheers
Larry Ducie
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.