• Making HTTP server with multiple threads
     
    • In the previous exercise there is a problem, that InputStream.read() method ‘freezes’ the program until wanted page has been downloaded. So if some other ‘browser’ becomes ‘idle’ after opening the socket
      (eg. telnet 127.0.0.1 2000 ), other browsers can’t use the program any more.
    •  Modify the server to use multiple threads so, that for each (browser) call for page download a new thread is created. (java.lang.Thread ; Java Tutorial / Essential Java Classes / Doing Two or More Tasks At Once: Threads ).
       
  • Back