Skip to content

Instantly share code, notes, and snippets.

@kzk
Created May 3, 2010 13:29
Show Gist options
  • Save kzk/388088 to your computer and use it in GitHub Desktop.
Save kzk/388088 to your computer and use it in GitHub Desktop.
package org.msgpack.rpc;
import java.io.IOException;
import org.msgpack.rpc.client.Client;
import org.msgpack.rpc.server.*;
/**
* Hello world!
*
*/
public class App
{
public int hello0() {
System.out.println("hello0");
return 0;
}
public int hello1(int a) {
System.out.println("hello1");
return 1;
}
public int hello2(int a, int b) {
System.out.println("hello2");
return 2;
}
public static void main( String[] args )
{
Server s = new Server();
try {
System.out.println("listen!");
s.listen(1985, new App());
} catch (IOException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment