MasterComponent.cs 616 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections.Generic;
  2. using System.Net;
  3. namespace ETModel
  4. {
  5. public class LockInfo
  6. {
  7. public IPEndPoint Address;
  8. public ETTaskCompletionSource<bool> Tcs;
  9. public LockInfo(IPEndPoint address, ETTaskCompletionSource<bool> tcs)
  10. {
  11. this.Address = address;
  12. this.Tcs = tcs;
  13. }
  14. }
  15. public class MasterComponent : Component
  16. {
  17. /// 镜像的地址
  18. public readonly List<IPEndPoint> ghostsAddress = new List<IPEndPoint>();
  19. /// 当前获取锁的进程地址
  20. public IPEndPoint lockedAddress;
  21. /// 请求锁的队列
  22. public readonly Queue<LockInfo> queue = new Queue<LockInfo>();
  23. }
  24. }