appsettings.json 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. {
  2. "Sers": {
  3. /* 通讯层配置 */
  4. "CL": {
  5. /* 共用配置,子项共用,覆写子项未指定的配置 */
  6. "Config": {
  7. /* 请求超时时间(单位ms,默认300000) */
  8. "requestTimeoutMs": 300000,
  9. /* 后台处理消息的线程个数(单位个,默认2) */
  10. "workThreadCount": 4,
  11. //HeartBeat
  12. /* 心跳检测超时时间(单位ms,默认30000) */
  13. "heartBeatTimeoutMs": 30000,
  14. /* 心跳检测失败重试次数(单位次,默认10) */
  15. "heartBeatRetryCount": 10,
  16. /* 心跳检测时间间隔(单位ms,默认10000,若指定为0则不进行心跳检测) */
  17. "heartBeatIntervalMs": 10000,
  18. /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
  19. "secretKey": "SersCL"
  20. },
  21. /* one conn is one channel.can be multiable */
  22. "Server": [
  23. {
  24. //Ipc.NamedPipe
  25. /* (x.1) type */
  26. /* 在此Assembly中查找builder */
  27. "assemblyFile": "Sers.CL.Ipc.NamedPipe.dll",
  28. /* the class of builder in assemblyFile */
  29. //"className": "Sers.CL.Ipc.NamedPipe.OrganizeServerBuilder",
  30. /* (x.2) config */
  31. /* 命名管道名称。例如: "Sers.CL.Ipc" */
  32. "pipeName": "Sers.CL.Ipc"
  33. },
  34. {
  35. // Socket.Iocp
  36. /* (x.1) type */
  37. /* 在此Assembly中查找builder */
  38. "assemblyFile": "Sers.CL.Socket.Iocp.dll",
  39. /* the class of builder in assemblyFile */
  40. "className": "Sers.CL.Socket.Iocp.OrganizeServerBuilder",
  41. /* 通信模式(默认值:Simple)。可为 Simple、Timer、SpinWait */
  42. //"mode": "Timer",
  43. /* 接收缓存区大小(单位:byte,默认:8192) */
  44. "receiveBufferSize": 8192,
  45. /* 发送缓冲区刷新间隔(单位:毫秒,默认:1)(仅当mode为Timer和SpinWait时有效) */
  46. "sendFlushInterval": 1,
  47. /* 发送缓冲区数据块的最小大小(单位:byte,默认 1000000)(仅当mode为Timer和SpinWait时有效) */
  48. "sendBufferSize": 1000000,
  49. /* 发送缓冲区个数(默认1024)(仅当mode为Timer和SpinWait时有效) */
  50. "sendBufferCount": 1024,
  51. /* (x.2) config */
  52. /* 服务端 监听地址。若不指定则监听所有网卡。例如: "127.0.0.1"、"sers.cloud"。*/
  53. //"host": "127.0.0.1",
  54. /* 服务端 监听端口号。例如: 4501 */
  55. "port": 4501
  56. },
  57. {
  58. // Socket.ThreadWait
  59. /* (x.1) type - Socket */
  60. /* 在此Assembly中查找builder */
  61. "assemblyFile": "Sers.CL.Socket.ThreadWait.dll",
  62. /* the class of builder in assemblyFile */
  63. //"className": "Sers.CL.Socket.ThreadWait.OrganizeServerBuilder",
  64. /* (x.2) config */
  65. /* 服务端 监听地址。若不指定则监听所有网卡。例如: "127.0.0.1"、"sers.cloud"。*/
  66. //"host": "127.0.0.1",
  67. /* 服务端 监听端口号。例如: 4501 */
  68. "port": 4501
  69. },
  70. {
  71. // Zmq.ThreadWait
  72. /* (x.1) type */
  73. /* 在此Assembly中查找builder */
  74. "assemblyFile": "Sers.CL.ClrZmq.ThreadWait.dll",
  75. /* the class of builder in assemblyFile */
  76. //"className": "Sers.CL.ClrZmq.ThreadWait.OrganizeServerBuilder",
  77. /* (x.2) config */
  78. /* 地址。例如: "tcp://*:4502" 、 "ipc://4502" */
  79. "endpoint": "tcp://*:4502"
  80. },
  81. {
  82. // WebSocket
  83. /* (x.1) type */
  84. /* 在此Assembly中查找builder */
  85. "assemblyFile": "Sers.CL.WebSocket.dll",
  86. /* the class of builder in assemblyFile */
  87. //"className": "Sers.CL.WebSocket.OrganizeServerBuilder",
  88. /* (x.2) config */
  89. /* 服务端地址(默认为 "ws://0.0.0.0:4503") */
  90. "host": "ws://0.0.0.0:4503"
  91. },
  92. {
  93. // Zmq.FullDuplex
  94. /* (x.1) type */
  95. /* 在此Assembly中查找builder */
  96. "assemblyFile": "Sers.CL.Zmq.FullDuplex.dll",
  97. /* the class of builder in assemblyFile */
  98. //"className": "Sers.CL.Zmq.FullDuplex.OrganizeServerBuilder",
  99. /* (x.2) config */
  100. /* 地址。例如: "tcp://*:4504" 、 "ipc://4504" */
  101. "endpoint": "tcp://*:4504"
  102. },
  103. {
  104. //Ipc.SharedMemory
  105. /* (x.1) type */
  106. /* 在此Assembly中查找builder */
  107. "assemblyFile": "Sers.CL.Ipc.SharedMemory.dll",
  108. /* the class of builder in assemblyFile */
  109. //"className": "Sers.CL.Ipc.SharedMemory.OrganizeServerBuilder",
  110. /* (x.2) config */
  111. /* 共享内存名称。例如: "ipcTest" */
  112. "name": "ipcForStationDemo",
  113. /* 共享内存节点个数。例如: 64 */
  114. "nodeCount": 128,
  115. /* 共享内存节点大小。例如: 2048 */
  116. "nodeBufferSize": 102400
  117. }
  118. ]
  119. }
  120. },
  121. /* Vit工具配置,可不指定 */
  122. "Vit": {
  123. /* 队列模式,可不指定。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) */
  124. "ConsumerMode": "ConsumerCache_BlockingCollection"
  125. }
  126. }