liusuyi
2024-11-02 4acf06226c8414c7218769995660dee97271a57b
ard-work/src/main/java/com/ard/tianyu/netty/handler/ClientHandler.java
@@ -1,5 +1,6 @@
package com.ard.tianyu.netty.handler;
import com.ard.tianyu.model.cache.TyTcpServerCache;
import com.ard.tianyu.netty.TyNettyTcpClient;
import com.ard.tianyu.netty.command.BaseCmd;
import com.ard.tianyu.service.ITyService;
@@ -31,7 +32,7 @@
        InetSocketAddress ipSocket = (InetSocketAddress) ctx.channel().remoteAddress();
        String host = ipSocket.getHostString();
        int port = ipSocket.getPort();
        tyService.processMessage(host + ":" + port, command);
        tyService.processReplyMessage(host + ":" + port, command);
    }
    @Override
@@ -70,7 +71,7 @@
        int port = ipSocket.getPort();
        String host = ipSocket.getHostString();
        log.error("与天宇服务{}:{}连接断开!", host, port);
        TyTcpServerCache.putTcpServerCache(host + ":" + port, false);
        ctx.channel().eventLoop().schedule(() -> {
            log.error("天宇服务端链接不上,开始重连操作...");
            try {