ActorMessageSender.cs 670 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections.Generic;
  2. using System.Net;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. namespace ETModel
  6. {
  7. public sealed class ActorMessageSender : Entity
  8. {
  9. // actor的地址
  10. public IPEndPoint Address;
  11. public long ActorId;
  12. // 还没发送的消息
  13. public Queue<ActorTask> WaitingTasks = new Queue<ActorTask>();
  14. // 最近发送消息的时间
  15. public long LastSendTime;
  16. public TaskCompletionSource<ActorTask> Tcs;
  17. public int FailTimes;
  18. public int MaxFailTimes;
  19. public int Error;
  20. public override void Dispose()
  21. {
  22. if (this.IsDisposed)
  23. {
  24. return;
  25. }
  26. base.Dispose();
  27. this.Error = 0;
  28. }
  29. }
  30. }