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.
 
 
 

42 lines
1.4 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace JT808.Gateway.Configurations
  5. {
  6. public class JT808Configuration
  7. {
  8. public int TcpPort { get; set; } = 808;
  9. public int UdpPort { get; set; } = 808;
  10. public int QuietPeriodSeconds { get; set; } = 1;
  11. public TimeSpan QuietPeriodTimeSpan => TimeSpan.FromSeconds(QuietPeriodSeconds);
  12. public int ShutdownTimeoutSeconds { get; set; } = 3;
  13. public TimeSpan ShutdownTimeoutTimeSpan => TimeSpan.FromSeconds(ShutdownTimeoutSeconds);
  14. public int SoBacklog { get; set; } = 8192;
  15. public int EventLoopCount { get; set; } = Environment.ProcessorCount;
  16. public int ReaderIdleTimeSeconds { get; set; } = 3600;
  17. public int WriterIdleTimeSeconds { get; set; } = 3600;
  18. public int AllIdleTimeSeconds { get; set; } = 3600;
  19. /// <summary>
  20. /// 转发远程地址 (可选项)知道转发的地址有利于提升性能
  21. /// 按照808的消息,有些请求必须要应答,但是转发可以不需要有应答可以节省部分资源包括:
  22. // 1.消息的序列化
  23. // 2.消息的下发
  24. // 都有一定的性能损耗,那么不需要判断写超时 IdleState.WriterIdle
  25. // 就跟神兽貔貅一样。。。
  26. /// </summary>
  27. public List<string> ForwardingRemoteIPAddress { get; set; }
  28. }
  29. }