3
我試圖打開從我的android應用程序到在Roving Networks WiFly上運行的服務器的TCP連接。按名稱android tcp連接
:當我連接使用的IP地址的連接打開正確的,但如果我連接使用主機名,然後我得到一個錯誤,因此我的路由器作爲主機WiFly上WiFly出現與192.168.1.4
的IP地址無法打開主機「wifly」:沒有與主機名
這裏相關的地址使用的代碼片段:
try
{
InetAddress serverAddr = InetAddress.getByName("wifly");
Log.d("TCP Client", "C: Connecting...");
//create a socket to make the connection with the server
Socket socket = new Socket(serverAddr, SERVERPORT);
.......
}
任何想法嗎?
我修改了代碼在我的android上運行,但結果是這 –
結果是...? –