RE: getaddrinfo() returns EAI_NONAME
RE: getaddrinfo() returns EAI_NONAME
- Subject: RE: getaddrinfo() returns EAI_NONAME
- From: Satish Kilaru <email@hidden>
- Date: Fri, 28 Aug 2009 14:54:01 -0400
- Acceptlanguage: en-US
- Thread-topic: getaddrinfo() returns EAI_NONAME
Hi Eli
I have another machine with same OS X version (10.5.8) where I don't run into this issue. If I want to compare what is the difference between these two machines, what should I compare that is relevant for this issue?
--Satish
-----Original Message-----
From: macnetworkprog-bounces+skilaru=email@hidden [mailto:macnetworkprog-bounces+skilaru=email@hidden] On Behalf Of Eli Bach
Sent: Friday, August 28, 2009 2:09 PM
To: email@hidden
Subject: Re: getaddrinfo() returns EAI_NONAME
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
******************Legal Disclaimer***************************
"This communication may contain confidential and privileged material
for the sole use of the intended recipient. Any unauthorized review,
use or distribution by others is strictly prohibited. If you have
received the message in error, please advise the sender by reply
email and delete the message. Thank you."
****************************************************************
_______________________________________________
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