Java Decentralized Peer-to-Peer not receiving all peers messages

I have a P2P Peer class that contains threaded objects to Server and Client classes. Each peer MUST BE connected to each other peer.

I’ve managed to get the connections between all 10 peers possible; however, sending and receiving messages hasn’t worked completely correctly.

About 5-6 of the peers successfully send their messages to each peer (Peers with id 1-6), while the others (Peers with id 7-10) do not.

Since debugging threaded server-clients has been a headache, I was wondering if I could get some help.

//PeerClient broadcast
public void broadcast(String message){
    try{
        for(Socket peer : pservers){
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(peer.getOutputStream()));
            System.out.println("Sending message: " + message + " | to socket " + peer.getPort() + " with BufferedWriter " + bw.toString());
            bw.write(message);
            bw.newLine();
            bw.flush();
        }
    } catch (IOException e){
        e.printStackTrace();
    }
}


//PeerServer listening
public void listen2(){
    try{
        for(Socket s : pclients){
           ReceiveClient rc = new ReceiveClient(id, s);
           Thread pthread = new Thread(rc);
           pthread.start();
        }
    } catch (Exception ex){
        ex.printStackTrace();
    }
}


//ReceiveClient run
public void run(){
    String message = null;
    long f0 = System.nanoTime();
    long f1;
    try{
        BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream()));
        while(((f1 = System.nanoTime() - f0) / 1000000000.0) < 100.0){
            if((message = br.readLine())!= null){
                System.out.println("Message received: " + message);
                messages.add(message);
            }
        }
    } catch (IOException e){
        e.printStackTrace();
    }
}



//Sample Output
Sending message: <Local Process id>: hello others | to socket <destination socket>
Sending message: 3: hello others | to socket 5000
Sending message: 3: hello others | to socket 5001
Sending message: 3: hello others | to socket 5003
Sending message: 3: hello others | to socket 5004
Sending message: 3: hello others | to socket 5005
Sending message: 3: hello others | to socket 5006
Sending message: 3: hello others | to socket 5007
Sending message: 3: hello others | to socket 5008
Sending message: 3: hello others | to socket 5009

Message received: <Remote Procid>: hello others
Message received: 5: hello others
Message received: 2: hello others
Message received: 4: hello others

I feel as though the error is within these functions, but I’ve been wracking my head around it. Any help is appreciated.

If any other code is required, I’ll put it up.