// load options
Option.load();
// start server
final ServerContext server = RemoteServer.CONTEXT;
server.start();
LOG.log(Level.INFO, server.getStatus());
// start and connect client
final ClientContext client = RemoteClient.CONTEXT;
client.start("localhost");
client.send(Message.LOBBY_CHAT.createNew("Anyone wants to chat?"));
// in 5s stop everything
final Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
timer.cancel();
client.stop();
server.stop();
}
}, 5_000);
}