changeset 70:6a8b61884a97

(example) filesend writer for Cerium updated
author kazz@kazz187.st.ie.u-ryukyu.ac.jp
date Thu, 22 Oct 2009 21:26:46 +0900
parents d86f68912831
children 0352536c33fa
files examples/filesend/writer.c tools/Linda_library/ldserv tools/Linda_library/ldserv.dSYM/Contents/Info.plist tools/Linda_library/ldserv.dSYM/Contents/Resources/DWARF/ldserv tools/Linda_library/liblindaapi.a
diffstat 5 files changed, 33 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/examples/filesend/writer.c	Wed Oct 21 22:02:33 2009 +0900
+++ b/examples/filesend/writer.c	Thu Oct 22 21:26:46 2009 +0900
@@ -10,6 +10,7 @@
 
 #define PORT 10000
 
+#define SERIAL_REGIST_TUPLE_NO 1
 
 void
 mainLoop(int tid, int write_id, int fd)
@@ -32,24 +33,45 @@
 	psx_out(tid, write_id, addr, sb.st_size);
 	psx_sync_n();
 
-
 	return;
 }
 
+int get_serial_id(int tid) {
+	char *data;
+	int serial;
+	int seq;
+
+	seq = psx_in(tid, 65535);
+	psx_sync_n();
+	data = (char *)psx_reply(seq);
+	serial = atoi(data + LINDA_HEADER_SIZE);
+	psx_free(data);
+
+	return serial;
+}
+
+void send_serial_id(int tid, int serial_id) {
+	int safe_id = htonl(serial_id);
+
+	psx_out(tid, SERIAL_REGIST_TUPLE_NO, &safe_id, sizeof(safe_id));
+	psx_sync_n();
+}
 
 int
 main(int argc, char *argv[]) {
 	int len = 0;
 	int tspace;
-
+	int serial;
+	int xml_id;
+	
 	init_linda();
 	tspace = open_linda_java("localhost", PORT);
 	printf("open socket (tupple space id) = %d\n", tspace);
-
-	mainLoop(tspace, 10, fileno(stdin));
-
+	serial = get_serial_id(tspace);
+	xml_id = serial * 10;
+	mainLoop(tspace, xml_id, fileno(stdin));
+	sleep(1);
+	send_serial_id(tspace, serial);
 	printf("mainLoop finished\n");
 	exit(EXIT_SUCCESS);
 }
-
-
Binary file tools/Linda_library/ldserv has changed
--- a/tools/Linda_library/ldserv.dSYM/Contents/Info.plist	Wed Oct 21 22:02:33 2009 +0900
+++ b/tools/Linda_library/ldserv.dSYM/Contents/Info.plist	Thu Oct 22 21:26:46 2009 +0900
@@ -10,16 +10,16 @@
 		<string>6.0</string>
 		<key>CFBundlePackageType</key>
 		<string>dSYM</string>
+		<key>CFBundleSignature</key>
+		<string>????</string>
 		<key>CFBundleShortVersionString</key>
 		<string>1.0</string>
-		<key>CFBundleSignature</key>
-		<string>????</string>
 		<key>CFBundleVersion</key>
-		<string>1.0</string>
+		<string>1</string>
 		<key>dSYM_UUID</key>
 		<dict>
 			<key>i386</key>
-			<string>70 0e b8 31 f6 7b 5f a6  3a 11 b4 c1 0f d3 47 7f</string>
+			<string>FD417447-D90C-85E4-DCA1-760E6F9780E3</string>
 		</dict>
 	</dict>
 </plist>
Binary file tools/Linda_library/ldserv.dSYM/Contents/Resources/DWARF/ldserv has changed
Binary file tools/Linda_library/liblindaapi.a has changed