@Override
    protected void clientStart() throws RemotingException {
        try {
            connector = new NioSocketConnector(); //TCP Connector

            // connector.getFilterChain().addFirst("logging", new MinaLoggingFilter());
            connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new MinaCodecFactory(getCodec())));
            connector.getFilterChain().addLast("mdc", new MdcInjectionFilter());

            connector.setHandler(new MinaHandler(this));
            IoSessionConfig cfg = connector.getSessionConfig();
            cfg.setReaderIdleTime(remotingClientConfig.getReaderIdleTimeSeconds());
            cfg.setWriterIdleTime(remotingClientConfig.getWriterIdleTimeSeconds());
            cfg.setBothIdleTime(remotingClientConfig.getClientChannelMaxIdleTimeSeconds());
        } catch (Exception e) {
            throw new RemotingException("Mina Client start error", e);
        }
    }
@author Robert HG (254963746@qq.com) on 11/4/15.
lts-core/src/main/java/com/github/ltsopensource/remoting/mina/MinaRemotingClient.java