예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Conn"/> class.
        /// </summary>
        public Conn(string addr, Config config, IConnDelegate connDelegate)
        {
            if (string.IsNullOrEmpty(addr))
            {
                throw new ArgumentNullException("addr");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (connDelegate == null)
            {
                throw new ArgumentNullException("connDelegate");
            }

            _addr = addr;

            _config   = config.Clone();
            _delegate = connDelegate;

            _maxRdyCount      = 2500;
            _lastMsgTimestamp = DateTime.Now.UnixNano();

            _cmdChan         = new Chan <Command>();
            _msgResponseChan = new Chan <msgResponse>();
            _exitChan        = new Chan <int>();
            _drainReady      = new Chan <int>();
        }
예제 #2
0
 public MockProducerConn(IConnDelegate connDelegate)
 {
     _connDelegate = connDelegate;
     _closeCh      = new Chan <bool>();
     _pubCh        = new Chan <bool>();
     GoFunc.Run(router, "ProducerTest:router");
 }
예제 #3
0
 public MockProducerConn(IConnDelegate connDelegate)
 {
     _connDelegate = connDelegate;
     _closeCh = new Chan<bool>();
     _pubCh = new Chan<bool>();
     GoFunc.Run(router, "ProducerTest:router");
 }
예제 #4
0
파일: Conn.cs 프로젝트: yonglehou/NsqSharp
        /// <summary>
        /// Initializes a new instance of the <see cref="Conn"/> class.
        /// </summary>
        public Conn(string addr, Config config, IConnDelegate connDelegate)
        {
            if (string.IsNullOrEmpty(addr))
                throw new ArgumentNullException("addr");
            if (config == null)
                throw new ArgumentNullException("config");
            if (connDelegate == null)
                throw new ArgumentNullException("connDelegate");

            _addr = addr;

            _config = config.Clone();
            _delegate = connDelegate;

            _maxRdyCount = 2500;
            _lastMsgTimestamp = DateTime.Now.UnixNano();

            _cmdChan = new Chan<Command>();
            _msgResponseChan = new Chan<msgResponse>();
            _exitChan = new Chan<int>();
            _drainReady = new Chan<int>();
        }