import java.io.*; import java.net.*; import java.util.StringTokenizer; public class Server2{ public static void main(String argumendid[]) throws IOException{ ServerSocket ss=new ServerSocket(3001); while(true){ new Server2loim(ss.accept()); } } } class Server2loim extends Thread{ Socket sc; public Server2loim(Socket uus_sc){ sc=uus_sc; start(); } public void run(){ try{ PrintWriter valja=new PrintWriter(sc.getOutputStream(), true); BufferedReader fail=new BufferedReader( new FileReader("tervitus.txt") ); valja.println(" "); valja.println(" "); String rida=fail.readLine(); while(rida!=null){ valja.println(rida); rida=fail.readLine(); } sc.close(); }catch(Exception e){ System.out.println("Probleem: "+e); } } }