import java.io.*; import java.net.*; class Lugeja extends Thread{ BufferedReader sisse; PrintWriter valja; public Lugeja(Socket sc){ try{ sisse=new BufferedReader(new InputStreamReader( sc.getInputStream() )); valja=new PrintWriter(System.out, true); start(); }catch(Exception e){} } public void run(){ boolean veel=true; try{ while(veel){ String s=sisse.readLine(); valja.println(s); if(s==null)veel=false; } } catch(Exception e){ valja.println("ühenduse ots"); veel=false; } } }