Env.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace CommonNetwork_ICE.Util
  6. {
  7. /// <summary>
  8. /// 用来存储可更改型变量,启动ICE时由存储配置文件指定值或手动赋值来变更相关值
  9. /// </summary>
  10. public class Env
  11. {
  12. // ICE远程目的IP(服务器IP)
  13. public static String ICE_SEND_REMOTE_IP = "127.0.0.1";
  14. // ICE远程目的端口(服务器端口)
  15. public static int ICE_SEND_REMOTE_PORT = 15000;
  16. // ICE本机接收IP
  17. public static String ICE_RECV_LOCAL_IP = "127.0.0.1";
  18. // ICE本机接收端口
  19. public static int ICE_RECV_LOCAL_PORT = 40000;
  20. // 发送关键数据包时等待应答的超时时间(秒)
  21. public static int SEND_WAIT_ACK_TIME_OUT = 5;
  22. // 等待关键数据包的检测线程等待时间间隔(毫秒)
  23. public static int SEND_WAIT_ACT_THREAD_SLEEP_TIME = 100;
  24. // 关键数据包重发次数
  25. public static int MSG_SEND_REPEAT_TIMES = 3;
  26. // 客户端连接服务器等待次数
  27. public static int CLIENT_CONNECT_WAIT_TIME = 1000;
  28. // 服务器端消息发送后的应答检测线程个数
  29. public static int SEND_MSG_ACK_CHECK_THREAD_CNT = 10;
  30. // 错误代码,为0表示无错误
  31. public static int ENV_ERR_CODE = 0;
  32. // 服务器会话空闲时间(秒)
  33. public static int SERVER_SESSION_EXPIRE_TIME = 60;
  34. // 服务器会话检测间隔
  35. public static int SERVER_SESSION_CHECK_INTERVAL = 10;
  36. // 消息处理超时时间(毫秒)
  37. public static int MSG_PROC_TIME_OUT = 10;
  38. }
  39. }