Skip to content

Commit

Permalink
Add host IP and port to the popup
Browse files Browse the repository at this point in the history
This should help debugging problems with connection setup to the remote PC.
  • Loading branch information
fmauch committed Sep 8, 2020
1 parent 7832c42 commit 8f89e60
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public String sendCommand(String command) {
// 5 second timeout (make configurable?)
int timeout = 5*1000;
socket.connect(new InetSocketAddress(this.hostIp, this.portNr), timeout);
System.out.println("hostIp is: " + this.hostIp);
System.out.println("portNr is: " + this.portNr);


if (socket.isConnected()) {
// output stream creation
Expand All @@ -80,7 +83,7 @@ public String sendCommand(String command) {
}
socket.close();
} catch (IOException e) {
result = String.format("popup(\"The connection to the remote PC could not be established. Reason: %s\","
result = String.format("popup(\"The connection to the remote PC at " + this.hostIp + ":" + this.portNr + " could not be established. Reason: %s\","
+ "\"Receive program failed\", False, True, blocking=True)\n"
+ "sync()", e.getMessage());
}
Expand Down

0 comments on commit 8f89e60

Please sign in to comment.