aboutsummaryrefslogtreecommitdiff
path: root/src/IvyClient.java
diff options
context:
space:
mode:
authorjestin2001-08-06 14:33:34 +0000
committerjestin2001-08-06 14:33:34 +0000
commit4826af957608a54e4492815551f39ac543258fd1 (patch)
tree4d52af9139d265dd5b8a7a68523f3c352665d447 /src/IvyClient.java
parent8fef6a76959160bf73064be48d4aa36b48f27412 (diff)
downloadivy-java-4826af957608a54e4492815551f39ac543258fd1.zip
ivy-java-4826af957608a54e4492815551f39ac543258fd1.tar.gz
ivy-java-4826af957608a54e4492815551f39ac543258fd1.tar.bz2
ivy-java-4826af957608a54e4492815551f39ac543258fd1.tar.xz
Adding multicast ( IvyWatcher ), adding the new IvyDaemon program, removing
the debug code in Probe, and who knows what I've done in IvyClient ?
Diffstat (limited to 'src/IvyClient.java')
-rwxr-xr-xsrc/IvyClient.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/IvyClient.java b/src/IvyClient.java
index e99574c..069a45b 100755
--- a/src/IvyClient.java
+++ b/src/IvyClient.java
@@ -31,8 +31,9 @@ public class IvyClient extends Thread {
final static int SchizoToken = 6; /* avoid race condition in concurrent connexions */
final static int DirectMsg = 7;/* the peer sends a direct message */
final static int Die = 8; /* the peer wants us to quit */
- final static String StartArg = "\002";/* begin of arguments */
- final static String EndArg = "\003"; /* end of arguments */
+ /* test pour jdk1.3 */
+ final static String StartArg = "\u0002";/* begin of arguments */
+ final static String EndArg = "\u0003"; /* end of arguments */
private static boolean debug = (System.getProperty("IVY_DEBUG")!=null) ;
private Ivy bus;
@@ -150,7 +151,7 @@ public class IvyClient extends Thread {
*/
StringTokenizer st = new StringTokenizer(msg);
if(!st.hasMoreTokens()){close("Bad format no type '"+msg+"'");break;}
- token=st.nextToken();
+ token=st.nextToken().trim();
if (token.length()==0){close("Bad format no type '"+msg+"'");break;}
try {
msgtype = Integer.parseInt(token);
@@ -159,7 +160,9 @@ public class IvyClient extends Thread {
break;
}
if(!st.hasMoreTokens()){close("Bad format no id '"+msg+"'");break;}
- token=st.nextToken(StartArg);
+ /* IST */
+
+ token=st.nextToken(StartArg).trim();
/*
* TODO
* this doesn't work on jdk1.3 !!!
@@ -172,7 +175,7 @@ public class IvyClient extends Thread {
break;
}
String msgarg="";
- if (st.hasMoreTokens()) msgarg=st.nextToken("\n");
+ if (st.hasMoreTokens()) msgarg=st.nextToken("\n").trim();
/*
* second stage: process the message
*/
@@ -266,7 +269,7 @@ public class IvyClient extends Thread {
String buffer = type+" "+id+StartArg;
// Start at 1 because group 0 represent entire matching
for(int sub = 1; sub <= nbsub; sub++) {
- if (result.getSubStartIndex(sub) > -1) {
+ if (result.getStartIndex(sub) > -1) {
buffer += result.toString(sub)+EndArg;
}
}