mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-21 12:22:18 +02:00
Add port as for simple-netty-server
This commit is contained in:
parent
f1a2d0ed1b
commit
9d7e4be4af
@ -18,7 +18,8 @@ import org.slf4j.LoggerFactory;
|
||||
}
|
||||
|
||||
public static void startStandalone(String[] args) throws Exception {
|
||||
NettyMessagingService server = new NettyMessagingService(8081);
|
||||
int port = args.length > 0 ? Integer.parseInt(args[0]) : 8081;
|
||||
NettyMessagingService server = new NettyMessagingService(port);
|
||||
server.activate();
|
||||
server.registerHandler("simple", new NettyLoggingHandler());
|
||||
server.registerHandler("echo", new NettyEchoHandler());
|
||||
|
@ -14,22 +14,15 @@ import org.onlab.onos.cli.AbstractShellCommand;
|
||||
public class SimpleNettyServerCommand extends AbstractShellCommand {
|
||||
|
||||
//FIXME: Replace these with parameters for
|
||||
@Argument(index = 0, name = "serverIp", description = "Server IP address",
|
||||
@Argument(index = 0, name = "port", description = "Port to listen",
|
||||
required = false, multiValued = false)
|
||||
String serverIp = "127.0.0.1";
|
||||
String port = "8081";
|
||||
|
||||
@Argument(index = 1, name = "workers", description = "IO workers",
|
||||
required = false, multiValued = false)
|
||||
String workers = "6";
|
||||
|
||||
@Argument(index = 2, name = "messageLength", description = "Message length (bytes)",
|
||||
required = false, multiValued = false)
|
||||
String messageLength = "128";
|
||||
|
||||
@Override
|
||||
protected void execute() {
|
||||
try {
|
||||
startStandalone(new String[]{serverIp, workers, messageLength});
|
||||
startStandalone(new String[]{port});
|
||||
} catch (Exception e) {
|
||||
error("Unable to start server %s", e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user