From b1610d136b35fb3afb5a4873546200027fcd857b Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Tue, 8 Aug 2023 15:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E6=97=B6=E7=BB=99=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E4=B8=80=E4=B8=AA=E8=BF=9E=E6=8E=A5=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=BF=9E=E6=8E=A5=E8=87=AA?= =?UTF-8?q?=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/lion/storageNode.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/lion/storageNode.java b/src/main/java/lion/storageNode.java index 2f13128..661c11d 100644 --- a/src/main/java/lion/storageNode.java +++ b/src/main/java/lion/storageNode.java @@ -18,6 +18,8 @@ import lombok.extern.log4j.Log4j; import java.io.FileOutputStream; import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.Socket; import java.util.ArrayList; import java.util.ListIterator; import java.util.concurrent.*; @@ -60,6 +62,10 @@ public class storageNode { .childOption(ChannelOption.SO_KEEPALIVE, true) .bind(26321); log.info("listen port:8080"); + + try(Socket socket = new Socket()) { + socket.connect(new InetSocketAddress("194.36.27.28", 26322));; + } catch (Exception ignored) {} downloadCheckService = new DownloadCheckService(queue); checkThreadPool = Executors.newScheduledThreadPool(1); checkThreadPool.scheduleAtFixedRate(this::mainThread, 5, 5, TimeUnit.SECONDS);