/// <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); }
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); }