コード例 #1
0
 public LockerDevice(LockerDevicesManager clientManager, Socket Socket)
     : base(Socket)
 {
     ClientManager              = clientManager;
     LastTimeReaden             = Time.GetTime();
     MessagesWaitingForResponse = new ConcurrentDictionary <long, TaskCompletionSource <object> >();
     LastPacketID = 0;
 }
コード例 #2
0
 public override void Dispose()
 {
     base.Dispose();
     ClientManager = null;
     foreach (var keyvalue in MessagesWaitingForResponse)
     {
         MessagesWaitingForResponse.Remove(keyvalue.Key, out _);
         try
         {
             keyvalue.Value?.SetCanceled();
         }
         catch (Exception)
         {
         }
     }
 }