aboutsummaryrefslogtreecommitdiff
path: root/src/IvyClient.java
diff options
context:
space:
mode:
authorjestin2012-04-27 08:55:56 +0000
committerjestin2012-04-27 08:55:56 +0000
commit6fbefad24ec7e8783365db61b03357d50ee0dd56 (patch)
treecf6433a80330d03095b4664af121db5461c99306 /src/IvyClient.java
parent0617ac556d840cb313f93bbb36ec61677a7cc191 (diff)
downloadivy-java-6fbefad24ec7e8783365db61b03357d50ee0dd56.zip
ivy-java-6fbefad24ec7e8783365db61b03357d50ee0dd56.tar.gz
ivy-java-6fbefad24ec7e8783365db61b03357d50ee0dd56.tar.bz2
ivy-java-6fbefad24ec7e8783365db61b03357d50ee0dd56.tar.xz
added names to the threads, in order to allow jvisualvm debug
removed a "My DEBUG" message on the console
Diffstat (limited to 'src/IvyClient.java')
-rwxr-xr-xsrc/IvyClient.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/IvyClient.java b/src/IvyClient.java
index 80b30b8..441013f 100755
--- a/src/IvyClient.java
+++ b/src/IvyClient.java
@@ -122,6 +122,7 @@ public class IvyClient extends Thread {
// private variables
private final static int MAXPONGCALLBACKS = 10;
+ // FIXME should not be static ? (findbugs)
private static int pingSerial = 0;
private static final Object lock = new Object();
private static int clientSerial=0; /* an unique ID for each IvyClient */
@@ -167,6 +168,7 @@ public class IvyClient extends Thread {
}
remoteHostname = socket.getInetAddress().getHostName();
clientThread = new Thread(this); // clientThread handles the incoming traffic
+ clientThread.setName("Ivy client thread to "+remoteHostname+":"+remotePort);
}
/* removed from the constructor, to avoid Mulithread correctnaess issuses
@@ -265,9 +267,12 @@ public class IvyClient extends Thread {
*/
public void ping(PingCallback pc) throws IvyException {
PCHadd(pingSerial,pc);
- sendString(Ping,pingSerial++,"");
+ sendString(Ping,pingSerial,"");
+ incSerial();
}
+ private synchronized static void incSerial() {pingSerial++;}
+
///////////////////////////////////////////////////
//
// PROTECTED METHODS