use of org.magic.console.MTGConsoleHandler in project MtgDesktopCompanion by nicho92.
the class ConsoleServer method start.
@Override
public void start() throws IOException {
acceptor = new NioSocketAcceptor();
acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName(getString("ENCODING")))));
acceptor.getSessionConfig().setReadBufferSize(Integer.parseInt(getString("BUFFER-SIZE")));
acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, Integer.parseInt(getString("IDLE-TIME")));
acceptor.setHandler(new MTGConsoleHandler());
acceptor.bind(new InetSocketAddress(Integer.parseInt(getString("SERVER-PORT"))));
logger.info("Server started on port " + getString("SERVER-PORT"));
}
Aggregations