Ejemplo n.º 1
0
 public ConnectionPool(string host, int port, int poolSize, int connectionLifetimeMinutes)
 {
     target = new Server(host, port);
     ConnectionLifetimeMinutes = connectionLifetimeMinutes;
     if (poolSize > 0)
     {
         useLimiter = true;
         connectionLimiter = new Semaphore(poolSize, poolSize);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 public Connection(Server server)
 {
     Created = DateTime.Now;
     Server = server;
     var tsocket = new TSocket(server.Host, server.Port);
     _transport = new TBufferedTransport(tsocket, 1024);
     _protocol = new TBinaryProtocol(_transport);
     _client = new ThriftFlumeEventServer.Client(_protocol);
 }