|
@@ -7,6 +7,7 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
|
+import java.net.InetSocketAddress;
|
|
import java.net.Socket;
|
|
import java.net.Socket;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
|
@@ -28,7 +29,11 @@ public class SecondaryClient {
|
|
}
|
|
}
|
|
|
|
|
|
public VersionMessage connect() throws IOException {
|
|
public VersionMessage connect() throws IOException {
|
|
- this.rt = new Socket(ip, port);
|
|
|
|
|
|
+ this.rt = new Socket();
|
|
|
|
+ var adr=new InetSocketAddress(ip, port);
|
|
|
|
+ log.info("Connecting to {}", adr.toString());
|
|
|
|
+ this.rt=new Socket();
|
|
|
|
+ this.rt.connect(adr, 5000);
|
|
this.os = rt.getOutputStream();
|
|
this.os = rt.getOutputStream();
|
|
this.in = new CountDataInputStream(rt.getInputStream());
|
|
this.in = new CountDataInputStream(rt.getInputStream());
|
|
VersionMessage vm = new VersionMessage();
|
|
VersionMessage vm = new VersionMessage();
|