ActorLocationSender.cs 646 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections.Generic;
  2. using System.Net;
  3. namespace ETModel
  4. {
  5. // 知道对方的Id,使用这个类发actor消息
  6. public class ActorLocationSender : ComponentWithId
  7. {
  8. // actor的地址
  9. public IPEndPoint Address;
  10. public long ActorId;
  11. // 还没发送的消息
  12. public Queue<ActorTask> WaitingTasks = new Queue<ActorTask>();
  13. // 最近发送消息的时间
  14. public long LastSendTime;
  15. public int FailTimes;
  16. public const int MaxFailTimes = 5;
  17. public ETTaskCompletionSource<ActorTask> Tcs;
  18. public override void Dispose()
  19. {
  20. if (this.IsDisposed)
  21. {
  22. return;
  23. }
  24. base.Dispose();
  25. }
  26. }
  27. }