There is such C ++ code in the NDK:
{ boost::asio::io_service ios; boost::asio::ip::tcp::socket sock(ios); boost::system::error_code ec; boost::asio::ip::tcp::endpoint ep(boost::asio::ip::address::from_string("xx.xx.xx.xx"), 44550); sock.connect(ep, ec); LOGI("out2: ec=%s\n", ec.message().c_str()); }
But in the output I get: out2: ec=Network is unreachable
If this code is compiled and run on a PC, everything is OK.
The application manifest specifies <uses-permission android:name="android.permission.INTERNET" />
Ideas?
ps I test on the emulator.
psps as NDK is used crystax-ndk-10.3.2-linux-x86_64
Unavailable
. - tasheehoo