case 'J': //adicionar este cliente a minha sala Linkedlist l = myServer.Clients(); Synchronized(l) { Iterator it = l.iterator(); InetSocketAddress address = new InetSocketAddress (p.getAddress(), 0); while(it.hasNext()){ //InetSocketAddress tmp = it.next(); if(it.next().getAddress() == p.getAddress() /*&& tmp.getPort() == 0*/){ //mandar msg ao cliente a dizer que ja existe answerPort = Integer.parseInt(st.nextToken()); s = new Socket(p.getAddress(), answerPort.intValue()); os = s.getOutputStream(); data = "-1".getBytes(); os.write(data); break; } } }