Android problems with addrinfo

Previous topic - Next topic

Kitty Hello

Code (glbasic) Select

memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET; // AF_INET (IPv4) or AF_INET6 (IPv6) to force version
hints.ai_socktype = SOCK_STREAM;

getaddrinfo("localhost", NULL, &hints, &res);


I only get the loopback device this way. I need the Wifi address. Andone got a better insight what I might do wrong?

Slydog

My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Kitty Hello

1.) #include <ifaddrs.h> is not in the Android NDK
2.) It's Java code. It's an emergency option, but I hope for a native solution, still.
3.) I did this. It only returns 127.0.0.1 on Android (works on about any other platform).

I love Android.



NOT!

Slydog

I don't envy you having to almost master every platform in existence, with each having their own quirks. 
I still only know iOS and barely at that!   Well, good luck.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

MrTAToad

I couldn't find much about it unfortunately, apart from using NULL as the first parameter.

By the looks of it, it may be a bug :)