首先是main方法
package org.fiberhome.action;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import org.fiberhome.service.ServerChannelInitializer;
import org.fiberhome.utils.TcpServiceConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 服务器启动逻辑
*/
public class MainAction {
public static void main(String[] args) throws Exception {
int port = TcpServiceConfig.tcpPort;
if (args != null && args.length > 0) {
try {
port = Integer.valueOf(args[0]);
} catch (NumberFormatException e) {