public synchronized void sendList() throws IOException { ClientList l = new ClientList(); for (ServerThread st : sList) { if (st.life() && st != null) l.add(st.getName()); } for (ServerThread st : sList) { if (st.life() && st != null) st.getOut().writeObject(l); } }