private void UpdateCacheWithFullUpdate(byte[] data) { if (data == null || data.Length == 0) { throw new ArgumentException("The specified data was not valid", "data"); } lock (ResultCache) { ResultCache = CacheSerialiser.Deserialise(data); } }
private void SendFullCacheUpdate(IPAddress ip) { if (ip == null) { throw new ArgumentException("The specified IP address is not valid", "ip"); } if (!KnownNodes.Contains(ip)) { throw new ArgumentException("The ip address specified is not known.", "ip"); } // grab a copy of the cache CacheProvider <string, ClientResultMessage> temp = ResultCache; temp.ClearSubscribersNoNotify(); InterNodeCommunicationMessage msg = new InterNodeCommunicationMessage { Data = CacheSerialiser.Serialise(temp), IsLocalOnly = true, MessageType = InterNodeMessageType.FullCacheUpdateReceived }; SendToNode(ip, InterNodeCommunicationMessageSerialiser.Serialise(msg)); }