diff --git a/Dache.CacheHost/Communication/CacheHostServer.cs b/Dache.CacheHost/Communication/CacheHostServer.cs index 39f359c..f1e3866 100644 --- a/Dache.CacheHost/Communication/CacheHostServer.cs +++ b/Dache.CacheHost/Communication/CacheHostServer.cs @@ -41,6 +41,9 @@ internal class CacheHostServer : ICacheHostContract, IRunnable // The logger private readonly ILogger _logger; + // The invalid command string list + private readonly List _invalidCommandStringList = new List { "invalid command" }; + /// /// The constructor. /// @@ -103,6 +106,7 @@ public CacheHostServer(IMemCache memCache, ITagRoutingTable tagRoutingTable, ILo // Hook into received message event _server.MessageReceived += ReceiveMessage; + _server.Error += (sender, e) => { _logger.Warn("Dache Client Disconnected", e.Exception); }; } private void ReceiveMessage(object sender, MessageReceivedArgs e) @@ -326,6 +330,12 @@ private byte[] ProcessCommand(string command) } break; } + default: + { + // Invalid command + commandResult = CreateCommandResult(_invalidCommandStringList); + break; + } } // Return the result - may be null if there was no valid message diff --git a/Dache.CacheHost/Dache.CacheHost.csproj b/Dache.CacheHost/Dache.CacheHost.csproj index fb6d029..5926f41 100644 --- a/Dache.CacheHost/Dache.CacheHost.csproj +++ b/Dache.CacheHost/Dache.CacheHost.csproj @@ -48,9 +48,9 @@ ..\packages\SharpMemoryCache.1.0.0\lib\SharpMemoryCache.dll - + False - ..\packages\SimplSockets.1.3.0\lib\SimplSockets.dll + ..\packages\SimplSockets.1.3.1\lib\SimplSockets.dll diff --git a/Dache.CacheHost/packages.config b/Dache.CacheHost/packages.config index dbf7cfe..ebff8e0 100644 --- a/Dache.CacheHost/packages.config +++ b/Dache.CacheHost/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Dache.Client/Dache.Client.csproj b/Dache.Client/Dache.Client.csproj index 2a2b4d8..9250a1a 100644 --- a/Dache.Client/Dache.Client.csproj +++ b/Dache.Client/Dache.Client.csproj @@ -40,9 +40,9 @@ ..\packages\SharpMemoryCache.1.0.0\lib\SharpMemoryCache.dll - + False - ..\packages\SimplSockets.1.3.0\lib\SimplSockets.dll + ..\packages\SimplSockets.1.3.1\lib\SimplSockets.dll diff --git a/Dache.Client/packages.config b/Dache.Client/packages.config index dbf7cfe..ebff8e0 100644 --- a/Dache.Client/packages.config +++ b/Dache.Client/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Dache.PerformanceTests/RemovedItemCallback/RemovedItemCallbackTest.cs b/Dache.PerformanceTests/RemovedItemCallback/RemovedItemCallbackTest.cs index a0b3887..77c2042 100644 --- a/Dache.PerformanceTests/RemovedItemCallback/RemovedItemCallbackTest.cs +++ b/Dache.PerformanceTests/RemovedItemCallback/RemovedItemCallbackTest.cs @@ -21,7 +21,7 @@ public static void Run() cacheClient.HostDisconnected += (sender, e) => { Console.WriteLine("*** Host disconnected"); }; cacheClient.HostReconnected += (sender, e) => { Console.WriteLine("*** Host reconnected"); }; - cacheClient.CacheItemExpired += (sender, e) => { Interlocked.Increment(ref totalCallbacks); Console.WriteLine(string.Format("Cache key expired: {1}, Total Removed: {1}", e.CacheKey, totalCallbacks)); }; + cacheClient.CacheItemExpired += (sender, e) => { Interlocked.Increment(ref totalCallbacks); Console.WriteLine(string.Format("Cache key expired: {0}, Total Removed: {1}", e.CacheKey, totalCallbacks)); }; // Add items for (int i = 0; i < itemsToAdd; i++)