Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4291378

Termination of thread blocked carrying out I/O - deprecation of stop method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs
    • x86
    • windows_nt



      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)
      ======================================================================

            mr Mark Reinhold
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: