You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
814 B

  1. using DotNetty.Transport.Channels;
  2. using JT808.DotNetty.Metadata;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. namespace JT808.DotNetty.Test
  7. {
  8. public class JT808DefaultChannelId : IChannelId
  9. {
  10. private static readonly JT808AtomicCounter jT808AtomicCounter = new JT808AtomicCounter();
  11. private string Id {
  12. get
  13. {
  14. return Guid.NewGuid().ToString("N");
  15. }
  16. }
  17. public string AsLongText()
  18. {
  19. return Id;
  20. }
  21. public string AsShortText()
  22. {
  23. return Id;
  24. }
  25. public int CompareTo(IChannelId other)
  26. {
  27. if(other.AsShortText()== Id)
  28. {
  29. return 1;
  30. }
  31. return 0;
  32. }
  33. }
  34. }