public void start() {

        isServerRunning = true;

        try {
            ServerSocket serverSocket = new ServerSocket(port);

            display("Server is listening on port " + port + ".");

            while (isServerRunning) {
                Socket socket = serverSocket.accept();
                display("Server accepted the client from " + socket.getInetAddress() + "\n");

                if (!isServerRunning)
                    break;

                ClientThread thread = new ClientThread(socket);
                clientList.add(thread);
                thread.start();
            }

            try {
                display("The Server is Shutting Down...");
                serverSocket.close();
                for (int i = 0; i < clientList.size(); i++) {
                    ClientThread tc = clientList.get(i);

                    tc.sInput.close();
                    tc.sOutput.close();
                    tc.socket.close();
                }

            } catch (IOException e) {
                logEvent("Error: Exception closing the server and the clients: " + e.getMessage());
            }

        } catch (IOException e) {
            String msg = dateFormat.format(new Date()) + "Exception on new ServerSocket: " + e.getMessage();
            logEvent(msg);
        }

    }