Any idea about gethostbyname on Android 4.0?

773 Views Asked by At

Our apk will connect to a server automatically when the user switches wifi network. It will invoke gethostbyname to find the server's ip first and then connect to the ip. All these code is written in C++.Everything works priori to Android 4.0. But in Android 4.0, gethostbyname returns the original ip for the server after switching the wifi network. So the apk's connection timeouts. The only possible solution is to restart the apk. But the java code InetAddress.getAllByName works ok. So what's wrong with Android 4.0's gethostbyname in C?

0

There are 0 best solutions below