Created
February 16, 2016 13:12
-
-
Save JamieAP/c732c5ebde8b1b56031e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
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); | |
} catch (Exception e) { | |
Throwables.propagate(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment