public void runPeerDiscovery() throws IOException {
        int count = 0;
        ServerSocket peerDiscovery = new ServerSocket(PORT, 100); // start
                                                                    // server at
                                                                    // a
                                                                    // designated
                                                                    // port #
        System.out
                .println("PEERDISCOVERY>>> Server up and ready for connections...\n");
        do {
            try { // accepting the connection - we could try breaking this up
                    // we will create up to 10 threads
                Socket connection = peerDiscovery.accept();
                System.out
                        .println("PEERDISCOVERY>>> Connection recieved from IP: "
                                + connection.getInetAddress().getHostName());

                // thread executor sends the connection socket to an existing
                // thread
                threadexecutor.execute(new Task(connection, count));
                count++;
            } catch (IOException ioException) {
                System.out
                        .println("PEERDISCOVERY>>> Failed to connect to Node");
            }

        } while (true);
    }