次のコード スニペットを実行します。
URL url = new URL(uri);
URLConnection urlconn = url.openConnection();
urlconn.connect();
urlconn.getContentLength();
デッドロックが発生することがありますが、通常は と の 2 行で発生urlconn.connect()
しurlconn.getContentLength()
ます。また、私がするとき
InputStream is = urlconn.getInputStream();
// doing some reading
is.close();
私も でブロックされis.close()
ます。なぜそのようなブロッキングが発生するのかをお聞きしたいです。Java APIからは私にはわかりません。