Transport endpoint is not connected

java.net.SocketTimeoutException: Transport endpoint is not connected java

個人解決方法是:將xxx.openConnection()改成以下代碼: android

01 HttpURLConnection conn = null;
02 String host = android.net.Proxy.getDefaultHost();
03 if (host != null) {
04 int port = android.net.Proxy.getDefaultPort();
05 SocketAddress vAddress = new InetSocketAddress(host, port);
06 java.net.Proxy vProxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, vAddress);
07 conn = (HttpURLConnection) downUrl.openConnection(vProxy);
08 } else {
09 conn = (HttpURLConnection) downUrl.openConnection();
10 }

隨後解決了這個問題 spa

相關文章
相關標籤/搜索