@Override
    protected void serverStart() throws RemotingException {
        NioServerConfig serverConfig = new NioServerConfig();
        serverConfig.setBacklog(65536);
        serverConfig.setReuseAddress(true);
        serverConfig.setTcpNoDelay(true);

        serverConfig.setIdleTimeBoth(remotingServerConfig.getServerChannelMaxIdleTimeSeconds());
        serverConfig.setIdleTimeWrite(remotingServerConfig.getWriterIdleTimeSeconds());
        serverConfig.setIdleTimeRead(remotingServerConfig.getReaderIdleTimeSeconds());

        final LtsCodecFactory codecFactory = new LtsCodecFactory(getCodec());

        server = new NioServer(serverConfig, new LtsEventHandler(this, "SERVER"), new ChannelInitializer() {
            @Override
            protected Decoder getDecoder() {
                return codecFactory.getDecoder();
            }

            @Override
            protected Encoder getEncoder() {
                return codecFactory.getEncoder();
            }
        });

        server.bind(new InetSocketAddress(this.remotingServerConfig.getListenPort()));
    }
@author Robert HG (254963746@qq.com) on 2/8/16.
lts-core/src/main/java/com/github/ltsopensource/remoting/lts/LtsRemotingServer.java