Ejemplo n.º 1
0
        /// <summary>
        /// Init method
        /// </summary>
        /// <param name="host">the host</param>
        /// <param name="port">the port</param>
        /// <param name="timeout">timeout of DRPC</param>
        public DRPCClient(string host, int port, int timeout = 0, bool reconnect = false, int maxIdle = 100)
        {
            thriftConfig.Host               = host;
            thriftConfig.Port               = port;
            thriftConfig.Timeout            = timeout;
            thriftConfig.MaxIdle            = maxIdle;
            thriftConfig.ReConnect          = reconnect;
            thriftConfig.MaxActive          = maxIdle;
            thriftConfig.MinIdle            = 0;
            thriftConfig.ValidateOnBorrow   = false;
            thriftConfig.ValidateOnReturn   = false;
            thriftConfig.ValidateWhiledIdle = false;

            thriftPool = new ThriftPool(thriftConfig);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Init method
        /// </summary>
        /// <param name="host">the host</param>
        /// <param name="port">the port</param>
        /// <param name="timeout">timeout of DRPC</param>
        public DRPCClient(string host, int port, int timeout = 0, bool reconnect = false, int maxIdle = 100)
        {            
            thriftConfig.Host = host;
            thriftConfig.Port = port;
            thriftConfig.Timeout = timeout;
            thriftConfig.MaxIdle = maxIdle;
            thriftConfig.ReConnect = reconnect;
            thriftConfig.MaxActive = maxIdle;
            thriftConfig.MinIdle = 0;
            thriftConfig.ValidateOnBorrow = false;
            thriftConfig.ValidateOnReturn = false;
            thriftConfig.ValidateWhiledIdle = false;

            thriftPool = new ThriftPool(thriftConfig);
        }