public void bootstrap() {

        this.pool = Executors.newCachedThreadPool();

        try {
            this.server = new ServerSocket(port);
            log.info("server start listening : "+port);

            mainThread = new Thread(new Runnable() {

                @Override
                public void run() {
                    log.info("server started successfully");
                    log.info("server waiting for new connection...");
                    while (true) {

                        try {
                            Socket client = server.accept();

                            pool.submit(new ClientHandler(client, securityPackage, authenticatedUsers));
                        } catch (Throwable e) {
                            log.error("error occurs while accept new connection: ", e);
                            throw new RuntimeException(e);
                        }
                    }
                }
            });

            mainThread.start();

        } catch (Throwable e) {
            log.error("error while binding server port:", e);
            throw new RuntimeException(e);
        }


    }