All pastes #265038 Raw Edit

Something

public java v1 · immutable
·published 2006-12-02 23:19 UTC
rendered paste body
case 'J': //adicionar este cliente a minha sala        Linkedlist l = myServer.Clients();        Synchronized(l) {	Iterator<InetSocketAddress> 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;		}	}}