/**
  * Returns the name of the listen thread.
  *
  * @return the thread name if in listening mode, otherwise <code>null</code>.
  * @since 1.6
  */
 public String getThreadName() {
   ServerThread st = server;
   if (st != null) {
     return st.getName();
   } else {
     return null;
   }
 }
예제 #2
0
파일: Server.java 프로젝트: w4-pwr/studia
 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);
   }
 }