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);