SimpleServer.java 443 Bytes
package org.onlab.netty;

public final class SimpleServer {
    private SimpleServer() {}

    public static void main(String... args) throws Exception {
        NettyMessagingService server = new NettyMessagingService(8080);
        server.activate();
        server.setPayloadSerializer(new KryoSerializer());
        server.registerHandler("simple", new LoggingHandler());
        server.registerHandler("echo", new EchoHandler());
    }
}