view src/msgpack/test/TestMsgPackClient.java @ 0:d86770305c8b draft

add TestJava
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Fri, 11 May 2012 02:30:59 +0900
parents
children 830afc6475b0
line wrap: on
line source

package msgpack.test;

import org.msgpack.rpc.Client;
import org.msgpack.rpc.loop.EventLoop;
 
public class TestMsgPackClient {
    public static interface RPCInterface {
        String hello(String msg, int a);
    }
 
    public static void main(String[] args) throws Exception {
        EventLoop loop = EventLoop.defaultEventLoop();
        
        Client cli = new Client("localhost", 8888, loop);
        RPCInterface iface = cli.proxy(RPCInterface.class);
 
        String msg = iface.hello("hello", 1);
        System.out.println(msg);
    }
}