× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




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



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.