# HG changeset patch # User one # Date 1256373501 -32400 # Node ID 5b1f099da5939e179fa56eaa2687fd9259dea1af # Parent be8bc83c001ac5618947989500dc8cb79421bc3a user id format fix diff -r be8bc83c001a -r 5b1f099da593 examples/filesend/writer.c --- a/examples/filesend/writer.c Fri Oct 23 16:47:33 2009 +0900 +++ b/examples/filesend/writer.c Sat Oct 24 17:38:21 2009 +0900 @@ -76,6 +76,8 @@ mainLoop(tspace, xml_id, fileno(stdin)); sleep(1); send_serial_id(tspace, serial); - printf("mainLoop finished\n"); + printf("send xml_id = %d, seciral = %d\n",xml_id, serial); exit(EXIT_SUCCESS); } + +/* end */ diff -r be8bc83c001a -r 5b1f099da593 src/fdl/TupleSpace.java --- a/src/fdl/TupleSpace.java Fri Oct 23 16:47:33 2009 +0900 +++ b/src/fdl/TupleSpace.java Sat Oct 24 17:38:21 2009 +0900 @@ -9,7 +9,6 @@ public class TupleSpace { static final boolean debug = true; public static int user = 0; - public byte userchar[] = new byte[2]; public Tuple[] tuple_space; public IOHandlerHook hook = new NullIOHandlerHook(); private FDLindaServ fds; @@ -37,11 +36,16 @@ user++; - ByteBuffer data = ByteBuffer.allocate(2); - userchar[0] = (byte) (user/10 + '0'); - userchar[1] = (byte) (user%10 + '0'); - data.put(userchar[0]); - data.put(userchar[1]); + ByteBuffer data = ByteBuffer.allocate(10); + ByteBuffer r = ByteBuffer.allocate(10); + int value = user; + while(value>0) { + r.put((byte) (value%10 + '0')); + value /= 10; + } + for(int i=r.position()-1;i>=0;i--) { + data.put(r.get(i)); + } data.flip(); int id = TupleSpace.MAX_TUPLE_ID-1;