private void startServer(int port) {
        client_thread = new ClientServerThread[max_client_count];
		/* Creating server socket */
        System.out.println("Creating server on port " + port + "...");
        try {
            server_socket = new ServerSocket(port);
        } catch (IOException e) {
            System.out.println("Port " + port + " is not available.");
            System.exit(-1);
        }
        while (true) {
            try {
                client_socket = server_socket.accept();
                int i = 0;
                for (i = 0; i < max_client_count; i++) {
                    if (client_thread[i] == null) {
                        client_thread[i] = new ClientServerThread(client_socket);
                        client_thread[i].start();
                        break;
                    }
                    else {
                        if (client_thread[i].isClosed()) {
                            client_thread[i] = null;
                            --i;
                        }

                    }

                }
                if (i == max_client_count) {
                    PrintStream os = new PrintStream(client_socket.getOutputStream());
                    os.println("Server too busy. Try later.");
                    os.close();
                    client_socket.close();
                    System.out.println(client_socket.isClosed());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }