Name: mc57594 Date: 11/15/99
java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode)
There seems to be no way of stopping a thread that is blocking carrying out I/O
(for example connecting to a URL) - even by using interrupt, apart from calling
stop - which is now deprecated.
For example put the following in a thread run method and try to stop it:
URL url;
HttpURLConnection http;
int rcode = 0;
String rmesg = "";
String urlTxt = "http://www.a-bad-link.com";
url = new URL(urlTxt);
http = (HttpURLConnection)url.openConnection();
http.connect();
rmesg = http.getResponseMessage();
rcode = http.getResponseCode();
(Review ID: 97516)
======================================================================