diff msgpack/msgpack.k @ 1:68307ce6839d

add some files
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Mon, 14 May 2012 13:22:21 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/msgpack/msgpack.k	Mon May 14 13:22:21 2012 +0900
@@ -0,0 +1,26 @@
+using konoha.io.*;
+using konoha.socket.*;
+using konoha.math.*;
+
+void main(String[] args) {
+	int port = 8888;
+	print "port number = " + port;
+	
+	ServerSocket servSock = new ServerSocket(port, 1);
+	
+	print "accept...";
+	Socket sock = servSock.accept();
+	print "client connected";
+
+	InputStream in = sock.getInputStream();
+	OutputSteram out = sock.getOutputStream();
+
+	while ( !in.isClosed() ) {
+		String val = in.readMsgPack();
+		print val;
+		out <<< val <<< EOL;
+		out.flush();
+	}
+	out.close();
+	in.close();
+}
\ No newline at end of file