Browse Source

improve logging

Martin Kunz 5 years ago
parent
commit
9471d4fd38
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/main/java/at/acdp/urweb/sclient/SecondaryClient.java

+ 6 - 1
src/main/java/at/acdp/urweb/sclient/SecondaryClient.java

@@ -7,6 +7,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.*;
+import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.nio.charset.StandardCharsets;
 
@@ -28,7 +29,11 @@ public class SecondaryClient {
     }
 
     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.in = new CountDataInputStream(rt.getInputStream());
         VersionMessage vm = new VersionMessage();