No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

49 líneas
1.0 KiB

  1. using JT808.DotNetty.Metadata;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace JT808.DotNetty.Internal
  6. {
  7. /// <summary>
  8. /// 计数包服务
  9. /// </summary>
  10. internal class JT808AtomicCounterService
  11. {
  12. private static readonly JT808AtomicCounter MsgSuccessCounter = new JT808AtomicCounter();
  13. private static readonly JT808AtomicCounter MsgFailCounter = new JT808AtomicCounter();
  14. public JT808AtomicCounterService()
  15. {
  16. }
  17. public long MsgSuccessIncrement()
  18. {
  19. return MsgSuccessCounter.Increment();
  20. }
  21. public long MsgSuccessCount
  22. {
  23. get
  24. {
  25. return MsgSuccessCounter.Count;
  26. }
  27. }
  28. public long MsgFailIncrement()
  29. {
  30. return MsgFailCounter.Increment();
  31. }
  32. public long MsgFailCount
  33. {
  34. get
  35. {
  36. return MsgFailCounter.Count;
  37. }
  38. }
  39. }
  40. }