aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjestin2006-07-28 09:18:43 +0000
committerjestin2006-07-28 09:18:43 +0000
commit0e446b2d4084f77858f35bdddb3168c876c63d5a (patch)
tree0f355746cc623abe4397193c2d9f029efa4d6de5
parente1beeb62319da8471c616451d51003d897218f3c (diff)
downloadivy-java-0e446b2d4084f77858f35bdddb3168c876c63d5a.zip
ivy-java-0e446b2d4084f77858f35bdddb3168c876c63d5a.tar.gz
ivy-java-0e446b2d4084f77858f35bdddb3168c876c63d5a.tar.bz2
ivy-java-0e446b2d4084f77858f35bdddb3168c876c63d5a.tar.xz
rajout d'un # de ping dans le protocole ping pong - cf Alex.
correction d'une typo Probe
-rwxr-xr-xsrc/IvyClient.java5
-rw-r--r--src/Probe.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/IvyClient.java b/src/IvyClient.java
index 5e71ccb..b0c1200 100755
--- a/src/IvyClient.java
+++ b/src/IvyClient.java
@@ -103,6 +103,7 @@ public class IvyClient implements Runnable {
final static char newLineChar = '\n';
// private variables
+ private static int pingSerial = 0;
private static Integer csMutex=new Integer(0);
private static int clientSerial=0; /* an unique ID for each IvyClient */
private Stack PCHStack = new Stack();
@@ -246,7 +247,7 @@ public class IvyClient implements Runnable {
*/
public void ping(PingCallback pc) throws IvyException {
PCHStack.push(new PingCallbackHolder(pc));
- sendString(Ping,0,"");
+ sendString(Ping,pingSerial++,"");
}
///////////////////////////////////////////////////
@@ -490,7 +491,7 @@ public class IvyClient implements Runnable {
((PingCallbackHolder)PCHStack.pop()).run();
break;
case Ping:
- sendString(Pong,0,"");
+ sendString(Pong,msgId.intValue(),"");
break;
case AddRegexp:
String regexp=s.substring(from,b.length);
diff --git a/src/Probe.java b/src/Probe.java
index 8ced8e5..56085fe 100644
--- a/src/Probe.java
+++ b/src/Probe.java
@@ -285,7 +285,7 @@ public class Probe implements IvyApplicationListener, IvyMessageListener, IvyBin
try {
((IvyClient)v.elementAt(i)).ping(new PingCallback() {
public void pongReceived(IvyClient ic,int elapsedTime){
- System.out.println("round trip to"+ic.getApplicationName()+" "+elapsedTime+" ms");
+ System.out.println("round trip to "+ic.getApplicationName()+" "+elapsedTime+" ms");
}
});
} catch (IvyException ie) {