上线时给服务器一个连接,使服务器连接自己
This commit is contained in:
parent
5d84ebd4ee
commit
b1610d136b
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user