import java.io.*; import java.net.*; public class PaariServer{ public static void main(String[] arg) throws IOException{ ServerSocket ss=new ServerSocket(3000); System.out.println("ootab"); Socket sc=ss.accept(); BufferedReader lugeja=new BufferedReader(new InputStreamReader(sc.getInputStream())); PrintWriter kirjutaja=new PrintWriter(sc.getOutputStream(), true); BufferedReader klaviatuur=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Oled valge"); kirjutaja.println("Oled must"); boolean veel=true; while(veel){ System.out.println("sinu kord"); String rida=klaviatuur.readLine(); kirjutaja.println("Valge: "+rida+". Sinu kord"); rida=lugeja.readLine(); System.out.println("Must: "+rida); } } }