aboutsummaryrefslogtreecommitdiff
path: root/src/IvyClient.java
diff options
context:
space:
mode:
authorjestin2004-12-23 16:12:25 +0000
committerjestin2004-12-23 16:12:25 +0000
commitccaba8df37149f7e744ebf9ff6a1dc350a32942b (patch)
tree04ecb2aeab20dec5e3ed13419e4dc50390f2a316 /src/IvyClient.java
parent031f955efd5fa20041f7344041f290b15b20c019 (diff)
downloadivy-java-ccaba8df37149f7e744ebf9ff6a1dc350a32942b.zip
ivy-java-ccaba8df37149f7e744ebf9ff6a1dc350a32942b.tar.gz
ivy-java-ccaba8df37149f7e744ebf9ff6a1dc350a32942b.tar.bz2
ivy-java-ccaba8df37149f7e744ebf9ff6a1dc350a32942b.tar.xz
preparing the 1.2.7 release
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) {