This question is 5 1/2 years old, yet it has not been answered nor been closed. That's why i am writing this, asuming the questioneer meant a Server-Client-Model.
I would recommend checking out NetCom2. It's an easy to use framework, which maintains a high modularity for future improvements.
The concept behind this framework, might seem pretty odd, because it is build as an "over-network" Event-Bus. The communication consists basically of objects, flying over the network and Servers/Clients reacting to it.
At the Server, you would write a java-programm, which might look like this:
public class ServerMain {
private ServerStart serverStart;
public ServerMain(int port) {
serverStart = ServerStart.at(port);
}
public void start() throws StartFailedException, ClientConnectionFailedException {
serverStart.launch();
serverStart.acceptAllNextClients();
}
}
And a potential Client would look like this:
public class ClientMain {
private ClientStart clientStart;
public ClientMain(String address, int port) {
clientStart = ClientStart.at(adress, port);
}
public void start() throws StartFailedException {
clientStart.launch();
}
}
This is how you create and start a Server and a Client.
You can tell both the Client and the Server how to react to certain Objects. This should be done before [clientStart/serverStart].launch() by stating:
clientStart.getCommunicationRegistration()
.register(MessageObject.class)
.addFirst(messageObject -> System.out.println(messageObject));
serverStart.getCommunicationRegistration()
.register(MessageObject.class)
.addFirst((session, messageObject) -> session.send(messageObject));
Now you can send something from the Client to the Server, by stating:
clientStart.send(new MessageObject());
This example is basically an echo-server, which is explained here.
The communication between both in more detail can be found here or here.
If you are overwhelmed by the produced output, you can Regulate it by stating:
// Choose only one.
NetComLogging.setLogging(Logging.trace());
NetComLogging.setLogging(Logging.debug());
NetComLogging.setLogging(Logging.info());
NetComLogging.setLogging(Logging.warn());
NetComLogging.setLogging(Logging.error());
NetComLogging.setLogging(Logging.disabled());
Which is explained in more detail here.
NOTINGS
Please note, that this project has just gone live and the documentation is still in progress.
Please also note, that this framework is still in beta. I would not recommend it for production use, but i would take a look at it for personal use.