if(argv.length == 2)
init(argv[0], argv[1]);
else
usage("Wrong number of arguments.");
try {
cat.info("Listening on port " + port);
ServerSocket serverSocket = new ServerSocket(port);
while(true) {
cat.info("Waiting to accept a new client.");
Socket socket = serverSocket.accept();
cat.info("Connected to client at " + socket.getInetAddress());
cat.info("Starting new socket node.");
new Thread(new SocketNode2(socket)).start();
}
}
catch(Exception e) {
e.printStackTrace();
}