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 08:25:45 -0600
Okay, I think the answer to my dns timeout problem is to go back to the
pthread killer solution. I got the timeout to work nicely using
pthread_cancel() and contrary to popular speculation, it doesn't
unleash any havoc on my memory footprint.
Here's the hitch though... gethostbyaddr() isn't threadsafe and it
really shows. I get all kinds of whacky garbledygook from it when
executed in separate pthreads. The answer is gethostbyaddr_r(), but no
such animal yet exists in OS X. So, I'll need to implement my own
gethostbyaddr_r(). Has anyone done this already or seen it somewhere
online?
Thanks.
- Philip
PS: Forget about the other longjmp() tangent I was on. I'm going to
stay focused on the pthread route, and the code is much less
complicated. :)
On Thursday, January 2, 2003, at 06:19 AM, Philip George wrote:
yep. in fact, that code i sent you isn't even run in the main thread.
On Thursday, January 2, 2003, at 06:10 AM, Andrew wrote:
On Thu, 2 Jan 2003, Philip George wrote:
Where's your .m file?
You don't need one - you can ask gcc to build using the objective C
compiler using the -x objective-c syntax.
I'm calling the functions from an Objective-C
method in a Cocoa app. That's the problem. When I put the code
into a
The code looks fine. You don't have multiple threads do you?
Andrew
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.