I try to create a console with "spring shell", I would like to run my own netty socket server command. I have a command:
@CliCommand(value = "server", help = "Start socket server")
public String server(
@CliOption(key = {"port", "p"}, mandatory = true, help = "Port number [49152-65535]") final String port,
@CliOption(key = {"maxclients", "mc"}, mandatory = false, help = "Max clients", unspecifiedDefaultValue = "50") final String maxClients
)
{
NettyServer nettyServer = new NettyServer(Integer.parseInt(port), Integer.parseInt(maxClients));
nettyServer.run();
return "::CliCommand return::";
}
While the server is running, it blocks the console and can not enter other commands. Should not you have a solution? For example, how to let it run alone and only influence the server by the command. For example, I would like to send messages from my console to clients.