Re: straight-C DNS lookup with timeout?
Re: straight-C DNS lookup with timeout?
- Subject: Re: straight-C DNS lookup with timeout?
- From: Philip George <email@hidden>
- Date: Thu, 2 Jan 2003 04:56:10 -0600
I think you're right, Lance. The NSException documentation has the
following warning:
"Note: The exception handling mechanism uses longjmp to control the
flow of execution. Any code written for an application that uses
exception handling is therefore subject to the restrictions associated
with this functionality. See your compiler documentation for more
information on the longjmp function."
And the exception handling documentation says:
"Note: You cannot use goto or return to exit an exception handling
domainerrors will result. Nor can you use the setjmp and longjmp
functions if the jump entails crossing an NS_DURING statement. Since
the code that your program calls may have exception-handling domains
within it, avoid using setjmp and longjmp in your application."
Does anyone know if it's possible to temporarily disable exceptions for
just a split second? Please resist the temptation to tell me why I
shouldn't do it. Just let me find out the hard way. If you know how,
please just explain and save me the lecture.
For now, I'm going to try posing as NSException and play around with
that a little. It's worth a shot.
And Lance, thanks for the tip. It would have taken me a while I think
to figure that out on my own. Much appreciated. :)
- Philip
On Tuesday, December 31, 2002, at 07:00 AM, Lance Bland wrote:
On Tuesday, December 31, 2002, at 07:37 AM, Philip George wrote:
Thanks, Andrew. The code you linked to works perfectly in a 100% C
app. However, if i call it from Obj-C, it fails with signal 10, if
and only if the alarm function gets called.
Anyone know why?
hi-
I didn't look at the code so I don't really know what you are doing,
but it could be because NSException uses longjmp, so maybe you are
getting tangled in the signal function installed by NSException? If
you ran it in gdb and gave a backtrace that could help.
-lance
------------------------------------
Lance Bland
mailto:email@hidden
VVI Is The #1 Visual-Report Tool Developer For Mac OS X
http://www.vvi.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.