Checking in vendor folder for ease of using go get.

This commit is contained in:
Renan DelValle 2018-10-23 23:32:59 -07:00
parent 7a1251853b
commit cdb4b5a1d0
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
3554 changed files with 1270116 additions and 0 deletions

View file

@ -0,0 +1,60 @@
using System;
using System.Threading;
using Thrift.Protocol;
using ZMQ;
using ZmqServer;
using ZmqClient;
namespace ZmqServer
{
class MainClass
{
public static void Main (string[] args)
{
new Thread(Server.serve).Start();
Client.work();
}
static class Server{
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);
tzs.Serve();
}
class StorageHandler:Storage.Iface{
int val=0;
public void incr(int amount){
val+=amount;
Console.WriteLine("incr({0})",amount);
}
public int get(){
return val;
}
}
}
static class Client{
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);
tzc.Open();
Console.WriteLine(client.@get());
client.incr(1);
client.incr(41);
Console.WriteLine(client.@get());
}
}
}
}