diff --git a/TestApp/MyService.cs b/TestApp/MyService.cs index 532866b..f412b5f 100644 --- a/TestApp/MyService.cs +++ b/TestApp/MyService.cs @@ -29,7 +29,7 @@ namespace TestApp Log.Info($"RPS: {counter}"); Interlocked.Exchange(ref counter, 0); }); - for (int i = 0; i < int.MaxValue; i++) + while(true) { try { diff --git a/ZeroLevel/Services/Network/SocketClient.cs b/ZeroLevel/Services/Network/SocketClient.cs index 7e99cc9..8d705f4 100644 --- a/ZeroLevel/Services/Network/SocketClient.cs +++ b/ZeroLevel/Services/Network/SocketClient.cs @@ -393,7 +393,7 @@ namespace ZeroLevel.Network _send_queue = new BlockingCollection(); continue; } - while (_stream.CanWrite == false || Status != SocketClientStatus.Working) + while (_stream?.CanWrite == false || Status != SocketClientStatus.Working) { try { diff --git a/ZeroLevel/Services/Network/Utils/ExClientServerCachee.cs b/ZeroLevel/Services/Network/Utils/ExClientServerCachee.cs index ac183c8..d036ce8 100644 --- a/ZeroLevel/Services/Network/Utils/ExClientServerCachee.cs +++ b/ZeroLevel/Services/Network/Utils/ExClientServerCachee.cs @@ -8,6 +8,11 @@ namespace ZeroLevel.Network internal sealed class ExClientServerCachee : IDisposable { + static ExClientServerCachee() + { + Sheduller.RemindEvery(TimeSpan.FromSeconds(30), () => { Log.Info(string.Join("\r\n", _clientInstances.Keys)); }); + } + private static readonly ConcurrentDictionary _clientInstances = new ConcurrentDictionary(); private static readonly ConcurrentDictionary _clientLocks = new ConcurrentDictionary();