Monday, May 28, 2012

[android-developers] Getaddrinfo flags on Android

Hi,

I'm trying to use getaddrinfo() on Android for resolving a hostname,
but I have an issue with a code like this:

struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET6;
hints.ai_flags = AI_V4MAPPED;
int res = getaddrinfo(hostname, NULL, &hints, &address);

I think that according to the getaddrinfo() documentation, this should
be a valid call. Nevertheless, getaddrinfo() returns EAI_BADFLAGS.
Does anybody know why?

When I don't set the ai_flags field, it works OK.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate