try {
ServerBootstrap b = new ServerBootstrap();
b.option(ChannelOption.SO_KEEPALIVE, true);
b.group(bossGroup, workerGroup);
b.channel(NioServerSocketChannel.class);
b.handler(new LoggingHandler(LogLevel.INFO));
b.childHandler(initializer);
// Bind and start to accept incoming connections.
ChannelFuture f = b.bind(port).sync();
this.state = ServerState.RUNNING;