@@ -0,0 +1,1249 @@
+package com.client;%0A%0Aimport io.netty.bootstrap.Bootstrap;%0Aimport io.netty.channel.Channel;%0Aimport io.netty.channel.EventLoopGroup;%0Aimport io.netty.channel.nio.NioEventLoopGroup;%0Aimport io.netty.channel.socket.nio.NioSocketChannel;%0A%0Aimport javax.swing.*;%0Aimport java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0A%0A/**%0A * @Author JamH%0A * Created by form on 2017-07-20.%0A */%0Apublic class ClientMain %7B%0A%0A    private static ClientMain client = new ClientMain();%0A    private String ip;%0A    private int port;%0A    private Channel channel;%0A%0A    public static ClientMain getInstance() %7B%0A        return client;%0A    %7D%0A%0A    public void config(String ip, int port)%7B%0A        this.ip = ip;%0A        this.port = port;%0A    %7D%0A%0A    public Channel getChannel() %7B%0A        return channel;%0A    %7D%0A%0A    public void run()%7B%0A        EventLoopGroup worker = new NioEventLoopGroup();%0A        Bootstrap bootstrap = new Bootstrap();%0A        bootstrap.group(worker);%0A        bootstrap.channel(NioSocketChannel.class);%0A        bootstrap.handler(new ClientInitHandler());%0A        try %7B%0A            this.channel = bootstrap.connect(ip, port).sync().channel();%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

Create ClientMain.java