import java.net.*; import java.io.*; public class Peer { PeerServer ps; PeerClient pc; ITypeThread itt; public Peer() { ps = new PeerServer(this); ps.start(); itt = new ITypeThread(this); itt.start(); pc = null; //pc = new PeerClient(this); //pc.start(); } // send the string msg to all peers except the one identified by s. public synchronized void bcastString(String msg, String s) { if(pc != null) pc.bcastString(msg, s); ps.bcastString(msg, s); } public synchronized void command(String s) { // assume that this is a connect command pc = new PeerClient(this, s); pc.start(); } public static void main(String[] args){ Peer p = new Peer(); } }