Commit fabdbcfd authored by AfirSraftGarrier's avatar AfirSraftGarrier

格式并加些打印

parent 88980bb9
......@@ -8,8 +8,6 @@ import org.springframework.stereotype.Component;
@Component
@Slf4j
public class ForwardClient {
private TcpClient client = null;
private ForwardChannelInitializer channelInitializer;
......@@ -17,7 +15,6 @@ public class ForwardClient {
ForwardClientHandler handler;
public ForwardClient() {
}
public void startTcp(String host, int port, String appId) {
......@@ -31,5 +28,4 @@ public class ForwardClient {
client = new TcpClient(host, port, channelInitializer, listener);
client.start();
}
}
......@@ -15,7 +15,7 @@ public class TcpClient {
private BaseChannelInitializer channelInitializer;
private BaseConnectionListener connectionListener;
public TcpClient(String host, int port,BaseChannelInitializer channelInitializer,BaseConnectionListener connectionListener) {
public TcpClient(String host, int port, BaseChannelInitializer channelInitializer, BaseConnectionListener connectionListener) {
this.host = host;
this.port = port;
this.channelInitializer = channelInitializer;
......@@ -23,9 +23,7 @@ public class TcpClient {
}
public void start() {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
Thread thread = new Thread(() -> {
try {
EventLoopGroup eventLoopGroup = new NioEventLoopGroup();
Bootstrap bootstrap = new Bootstrap();
......@@ -39,14 +37,9 @@ public class TcpClient {
future.addListener(connectionListener);
} catch (Exception e) {
// TODO Auto-generated catch block
log.error("Tcp客户端异常,端口:{}",port);
}
log.error("Tcp客户端异常,端口:{}", port);
}
});
thread.start();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment