import java.net.*; import java.io.*; import java.util.*; public class teams{ public static void main(String argumendid[]){ try{ ServerSocket ss=new ServerSocket(3001); Vector kass=new Vector(); Vector koer=new Vector(); int i=1,h=2; while(true){ Socket s=ss.accept(); PrintWriter valja=new PrintWriter(s.getOutputStream(), true); if(i==1){ i=2; h=1; valja.println("Sa oled vőistkonnast Kass!"); kass.add(s); new loim(s, kass); }else{ i=1; h=2; valja.println("Sa oled vőistkonnast Koer!"); koer.add(s); new loim(s, koer); } } }catch(Exception q){System.out.println("Viga: "+q);} } } class loim extends Thread{ Vector v; Socket s; public loim(Socket usc, Vector uv){ v=uv; s=usc; start(); } public void run(){ while(true){ } } }