Re: getaddrinfo() returns EAI_NONAME
Re: getaddrinfo() returns EAI_NONAME
- Subject: Re: getaddrinfo() returns EAI_NONAME
- From: Eli Bach <email@hidden>
- Date: Fri, 28 Aug 2009 11:09:10 -0700
On Aug 28, 2009, at 10:07 AM, Satish Kilaru wrote:
HI All
I have a service that starts at boot time. Upon machine reboot my
service starts up. But getaddrinfo() returns EAI_NONAME. If I kill
the service and start It again from a login shell, getaddrinfo()
works fine.
What could be the reason? Is it because my service is starting
before some system service?
First, unless you are supporting older OS's (like 10.3), you should be
using launchservices instead of a SystemStartup item
Second, yes, given your plist, most likely your daemon is loading
before the network stack has loaded and configured. With a
SystemStartupItem, you can add a dependency, so that your daemon loads
after the network stack is loaded (but you may still not have a valid
network connection).
With launchservices, you need to test yourself whether the network is
available and then try to resolve the name. Or you could just retry
the operation after a period of time.
Eli
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden