From dc4d96ff05b50617c685d90d625c6e2617c81dde Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Fri, 01 Nov 2024 14:53:54 +0800
Subject: [PATCH] 增加:航线 关闭:流媒体拉流
---
ard-work/src/main/java/com/ard/tianyu/netty/TyNettyTcpClient.java | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/ard-work/src/main/java/com/ard/tianyu/netty/TyNettyTcpClient.java b/ard-work/src/main/java/com/ard/tianyu/netty/TyNettyTcpClient.java
index 08065a6..e226263 100644
--- a/ard-work/src/main/java/com/ard/tianyu/netty/TyNettyTcpClient.java
+++ b/ard-work/src/main/java/com/ard/tianyu/netty/TyNettyTcpClient.java
@@ -1,6 +1,7 @@
package com.ard.tianyu.netty;
import com.ard.tianyu.config.TyConfiguration;
+import com.ard.tianyu.model.cache.TyTcpServerCache;
import com.ard.tianyu.netty.handler.ClientHandler;
import com.ard.tianyu.netty.handler.MessageProtocolDecoder;
import com.ard.tianyu.netty.handler.MessageProtocolEncoder;
@@ -72,10 +73,12 @@
ChannelFuture future = bootstrap.connect(host, port).addListener((ChannelFuture futureListener) -> {
if (futureListener.isSuccess()) {
log.info("连接天宇TCP服务器成功【{}:{}】", host, port);
+ TyTcpServerCache.putTcpServerCache(host + ":" + port, true);
} else {
final EventLoop eventLoop = futureListener.channel().eventLoop();
eventLoop.schedule(() -> {
log.info("连接天宇TCP服务器失败【{}:{}】,正尝试重连...", host, port);
+ TyTcpServerCache.putTcpServerCache(host + ":" + port, false);
try {
initConnection(host, port);
} catch (Exception e) {
--
Gitblit v1.9.3