view msgpack/client.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 source

using konoha.io.*;
using konoha.socket.*;


void main(String[] args) {
	int port = 8888;
	String host = "localhost";
	print "client program";
	print "port number = " + port;

	print "conect to " + host + "...";
	Socket sock = new Socket("localhost", port);
	
	InputStream in = sock.getInputStream();
	OutputSteram out = sock.getOutputStream();
	
	String cmd = "Math.sin(45)";
	print cmd;
	out.writeMsgPack(cmd);

	out.flush();
	while ( !in.isClosed() ) {
		String ret =in.readLine();
		print ret;
	}

	out.close();

	in.close();
}