aboutsummaryrefslogtreecommitdiff
path: root/src/IvyClient.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/IvyClient.java')
-rwxr-xr-xsrc/IvyClient.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/IvyClient.java b/src/IvyClient.java
index 753184a..a53e398 100755
--- a/src/IvyClient.java
+++ b/src/IvyClient.java
@@ -100,6 +100,7 @@ public class IvyClient implements Runnable {
private volatile Thread clientThread;// volatile to ensure the quick communication
private Integer clientKey;
private boolean discCallbackPerformed = false;
+ private String remoteHostname="unresolved";
// protected variables
String appName="none";
@@ -133,6 +134,7 @@ public class IvyClient implements Runnable {
// the registering will take place at the reception of the regexps...
}
}
+ remoteHostname = socket.getInetAddress().getHostName();
clientThread = new Thread(this); // clientThread handles the incoming traffic
clientThread.start();
}
@@ -170,6 +172,12 @@ public class IvyClient implements Runnable {
public String getApplicationName() { return appName ; }
/**
+ * returns the host name of the remote agent.
+ * @since 1.2.7
+ */
+ public String getHostName() { return remoteHostname ; }
+
+ /**
* allow an Ivy package class to access the list of regexps at a
* given time.
* perhaps we should implement a new IvyApplicationListener method to
@@ -339,6 +347,7 @@ public class IvyClient implements Runnable {
}
}
traceDebug("normally Disconnected from "+ appName);
+ bus.removeClient(this);
// invokes the disconnect applicationListeners
if (!discCallbackPerformed) bus.clientDisconnects(this);
discCallbackPerformed=true;
@@ -391,15 +400,15 @@ public class IvyClient implements Runnable {
private String dumpHex(String s) {
byte[] b = s.getBytes();
- String out = "";
+ String outDump = "";
String zu = "\t";
for (int i=0;i<b.length;i++) {
char c = s.charAt(i);
- out+=((int)c) + " ";
+ outDump+=((int)c) + " ";
zu+= ((c>15) ? c : 'X')+" ";
}
- out += zu;
- return out;
+ outDump += zu;
+ return outDump;
}
private String dumpMsg(String s) {