import java.io.*;
import java.net.*;

public class RegSvr {
   private int port;
   private String host;

   public RegSvr(String host, int port) {
      this.port = port;
      this.host = host;
   }

   public void processRequest(Socket sock) {
      try {

      }
      catch(Exception ex) {

      } 
   }

   public void run() {
      try {
         ServerSocket svr = new ServerSocket(port);
         Socket sock;
         while((sock = svr.accept()) != null) {
            processRequest(sock);
         }
      }
      catch(Exception ex) {
         ex.printStackTrace(System.err);
         System.exit(1);
      }
   }

   public static void main(String args[]) {
      if(args.length != 2) {
         System.err.println("usage: java RegSvr <host> <port>");
         System.exit(1);
      }
      RegSvr regsvr = new RegSvr(args[0], Integer.parseInt(args[1]));
      regsvr.run();
   }
}
