Esempio n. 1
0
        protected internal override IOperationResult ReadResponse(PooledSocket socket)
        {
            var retval = new Dictionary <string, CacheItem>();
            var cas    = new Dictionary <string, ulong>();

            try
            {
                GetResponse r;

                while ((r = GetHelper.ReadItem(socket)) != null)
                {
                    var key = r.Key;

                    retval[key] = r.Item;
                    cas[key]    = r.CasValue;
                }
            }
            catch (NotSupportedException)
            {
                throw;
            }
            catch (Exception e)
            {
                log.Error(e);
            }

            this.result = retval;
            this.Cas    = cas;

            return(new TextOperationResult().Pass());
        }
Esempio n. 2
0
        protected internal override IOperationResult ReadResponse(PooledSocket socket)
        {
            GetResponse r      = GetHelper.ReadItem(socket);
            var         result = new TextOperationResult();

            if (r == null)
            {
                return(result.Fail("Failed to read response"));
            }

            this.result = r.Item;
            this.Cas    = r.CasValue;

            GetHelper.FinishCurrent(socket);

            return(result.Pass());
        }