NetThreadComponent.cs 728 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Concurrent;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. namespace ET
  6. {
  7. public class NetThreadComponent: Entity
  8. {
  9. public static NetThreadComponent Instance;
  10. public const int checkInteral = 2000;
  11. public const int recvMaxIdleTime = 60000;
  12. public const int sendMaxIdleTime = 60000;
  13. #if NET_THREAD
  14. public Thread Thread;
  15. #endif
  16. public ThreadSynchronizationContext ThreadSynchronizationContext;
  17. public HashSet<AService> Services = new HashSet<AService>();
  18. #if NET_THREAD
  19. public bool isRun;
  20. #endif
  21. public Random Random = new Random(Guid.NewGuid().GetHashCode());
  22. }
  23. }