NetDefine.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. namespace XGame.Framework.Network
  2. {
  3. internal static class NetDefine
  4. {
  5. public const int SESSION_TIMEOUT = 4000;
  6. public const int SESSION_BUFFER_SIZE = 0x1000;//4096
  7. /// <summary>消息分帧时间限制-默认33毫秒</summary>
  8. public const int MsgFrameTimeLimit = 33;
  9. /// <summary>消息压缩长度-默认4097-目前客户端不做压缩</summary>
  10. public const int CompressThreshold = 0x1001;
  11. /// <summary>
  12. /// 心跳包的头部长度
  13. /// </summary>
  14. public const int HEAD_LENGTH_HEART = 2;
  15. /// <summary>
  16. /// Head+2(msgLength)
  17. /// Request、Response的头部长度
  18. /// </summary>
  19. public const int HEAD_LENGTH_REQUEST = 12;
  20. /// <summary>
  21. /// Push的头部头部长度
  22. /// </summary>
  23. public const int HEAD_LENGTH_PUSH = 8;
  24. /// <summary>
  25. /// 魔法值 也是版本号
  26. /// </summary>
  27. public const int MAGIC = 0x01;
  28. public const int CONN_PROTO_ID = 0;
  29. public const int CONN_SEQ_ID = 0;
  30. public const int GATEWAY_ERROR_ID = 1;
  31. }
  32. }