私はこの問題を解決しようとしましたが、これに対する良い解決策が得られませんでした。httsurlconnectionでソケットを開いて閉じました。しかし、開いたソケットは閉じず、ソケットの状態はCLOSE_WAITでした。これが私のコードとこのためのエアログです。私のコードの何が問題になっていますか?
String https_url = "https://www.google.com";
URL url = new URL(https_url);
try {
con = (HttpsURLConnection) url.openConnection();
con.setRequestProperty("Connection", "close");
if(con!=null){
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
String input = br.readLine();
while(input.length() != 0)
{
input = br.readLine();
}
br.close();
con.disconnect();
}
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}