/** * Server program for the chat example. * @param argv //host:port of rmiregistry */ import java.rmi.*; public class Server { public static void main (String[] argv) { try { if (argv.length > 0) Naming.rebind (argv[0] + "/Chat", new ChatServer (5)); else Naming.rebind ("Chat", new ChatServer (5)); System.out.println ("Chat Server is ready at " + argv[0] + "/Chat"); } catch (Exception e) { System.out.println ("Chat Server failed: " + e); } } }