public class VierGewinnt { public Vector games, clients; public static VierGewinnt one; public static void main(String args[]) { one = new VierGewinnt(); } public VierGewinnt() { this.games = new Vector(); this.clients = new Vector(); }
while(true) { clients.addElement(new ServerThread(ssock.accept(),clts++)); Thread.yield();}
public static synchronized void broadcastMsg(String msg) { try { for (int i=0;i<one.clients.size();i++) { ServerThread temp = (ServerThread)one.clients.elementAt(i); } } catch(NullPointerException e) { System.err.println("Error: "+e.toString()+ " in broadcastMsg()"); }}
class ServerThread extends Thread { (...) VierGewinnt.broadcastMsg(cmd);