communication through socket: one server and two clients
<p>I have three entities: A,B and C. A is a server and B and C are clients. 
A is a multithread server implemented using the class in <code>java.net</code></p>

<p>I would realize a communication in which B sends a message to A, A send a message to C and C send a message B.my question is: the clients C must be even a server or is must be only a client that forward the message?</p>

<pre><code>public class ServerA{

public static void main(String[] args){

    boolean listening = true;
    int port_number = 8888;

    try{

        ServerSocket ss = new ServerSocket(port_number);

        System.out.println("Waiting for incoming connection...");

        while(listening){

            new Thread(new ServerThread(ss.accept())).start();

        }

    }
    catch(IOException ioe){ioe.printStackTrace();}
}
}

public class ServerThread implements Runnable{

    @Override
    public void run(){

    }
</code></pre>

<p>}</p>
