コード例 #1
0
 public AsyncConnector(IRedisSocket socket, EndPoint endpoint, RedisIO io, int concurrency, int bufferSize)
 {
     _redisSocket                  = socket;
     _io                           = io;
     _concurrency                  = concurrency;
     _bufferSize                   = bufferSize;
     _asyncTransferPool            = new SocketAsyncPool(concurrency, bufferSize);
     _asyncTransferPool.Completed += OnSocketCompleted;
     _asyncReadQueue               = new ConcurrentQueue <IRedisAsyncCommandToken>();
     _asyncWriteQueue              = new ConcurrentQueue <IRedisAsyncCommandToken>();
     _readLock                     = new object();
     _writeLock                    = new object();
     _asyncConnectArgs             = new SocketAsyncEventArgs {
         RemoteEndPoint = endpoint
     };
     _asyncConnectArgs.Completed += OnSocketCompleted;
     _connectionTaskSource        = new ConcurrentQueue <TaskCompletionSource <bool> >();
 }