Ejemplo n.º 1
0
        /// <summary>
        /// Clears the cache.
        /// </summary>
        public void Clear()
        {
            byte[] command;
            using (var memoryStream = new MemoryStream())
            {
                memoryStream.Write("clear");
                command = memoryStream.ToArray();
            }

            // Send
            _client.Send(command);
        }
Ejemplo n.º 2
0
        private void CacheItemRemoved(CacheEntryRemovedArguments args)
        {
            byte[] command = null;
            using (var memoryStream = new MemoryStream())
            {
                memoryStream.Write("expire");
                memoryStream.WriteSpace();
                memoryStream.Write(args.CacheItem.Key);
                command = memoryStream.ToArray();
            }

            // Notify all clients
            _server.Send(command);
        }