| public static void Main (string[] args) |
| new Thread(Server.serve).Start(); |
| public static void serve(){ |
| StorageHandler s=new StorageHandler(); |
| Storage.Processor p=new Storage.Processor(s); |
| ZMQ.Context c=new ZMQ.Context(); |
| TZmqServer tzs=new TZmqServer(p,c,"tcp://127.0.0.1:9090",ZMQ.SocketType.PAIR); |
| class StorageHandler:Storage.Iface{ |
| public void incr(int amount){ |
| Console.WriteLine("incr({0})",amount); |
| public static void work() |
| Context ctx=new Context(); |
| TZmqClient tzc=new TZmqClient(ctx,"tcp://127.0.0.1:9090",SocketType.PAIR); |
| TBinaryProtocol p=new TBinaryProtocol(tzc); |
| Storage.Client client=new Storage.Client(p); |
| Console.WriteLine(client.@get()); |
| Console.WriteLine(client.@get()); |