import java.io.*; import java.net.*; public class Server1{ public static void main(String argumendid[]) throws IOException{ ServerSocket ss=new ServerSocket(3001); while (true){ Socket sc=ss.accept(); BufferedReader sisse=new BufferedReader(new InputStreamReader( sc.getInputStream() ) ); InetAddress aadress= sc.getInetAddress(); String ip= aadress.toString(); System.out.println(ip); sc.close(); } //while lopp //__________________ /* PrintWriter valja=new PrintWriter(sc.getInetAddress(), true); System.out.println(sisse.readLine()); valja.printeln("tegelane"); String rida=""; while((rida=sisse.readLine())!=null)System.out.println(rida);*/ //________________ } // main lopp }// Server1 lopp