Skip to content

Instantly share code, notes, and snippets.

@JamieAP
Created February 17, 2016 11:19
Show Gist options
  • Save JamieAP/ba4bcc0862e1dbac5369 to your computer and use it in GitHub Desktop.
Save JamieAP/ba4bcc0862e1dbac5369 to your computer and use it in GitHub Desktop.
ServerBootstrap b = new ServerBootstrap();
b.group(acceptorGroup, handlerGroup)
.channel(NioServerSocketChannel.class)
.childHandler(new MySocketInitialiser())
.option(ChannelOption.SO_BACKLOG, 5)
.childOption(ChannelOption.SO_KEEPALIVE, true);
b.localAddress(port).bind().sync();
LOG.info("Started on port {}", port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment