appsettings.json 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. "Client": [
  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.OrganizeClientBuilder",
  30. /* (x.2) config */
  31. // 命名管道只支持本机或局域网。
  32. /* 服务端机器名或者ip地址(如 103.23.23.23 、win10f),默认 "." */
  33. "serverName": ".",
  34. /* 命名管道名称。例如: "Sers.CL.Ipc" */
  35. "pipeName": "Sers.CL.Ipc"
  36. },
  37. {
  38. // Socket.Iocp
  39. /* (x.1) type */
  40. /* 在此Assembly中查找builder */
  41. "assemblyFile": "Sers.CL.Socket.Iocp.dll",
  42. /* the class of builder in assemblyFile */
  43. "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
  44. /* 通信模式(默认值:Simple)。可为 Simple、Timer、SpinWait */
  45. "mode": "Timer",
  46. /* 接收缓存区大小(单位:byte,默认:8192) */
  47. "receiveBufferSize": 8192,
  48. /* 发送缓冲区刷新间隔(单位:毫秒,默认:1)(仅当mode为Timer和SpinWait时有效) */
  49. "sendFlushInterval": 1,
  50. /* 发送缓冲区数据块的最小大小(单位:byte,默认 1000000)(仅当mode为Timer和SpinWait时有效) */
  51. "sendBufferSize": 1000000,
  52. /* 发送缓冲区个数(默认1024)(仅当mode为Timer和SpinWait时有效) */
  53. "sendBufferCount": 1024,
  54. /* (x.2) config */
  55. /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */
  56. //"host": "192.168.10.11",
  57. "host": "127.0.0.1",
  58. /* 服务端 监听端口号。例如: 4501 */
  59. "port": 4501
  60. },
  61. {
  62. // Socket.ThreadWait
  63. /* (x.1) type */
  64. /* 在此Assembly中查找builder */
  65. "assemblyFile": "Sers.CL.Socket.ThreadWait.dll",
  66. /* the class of builder in assemblyFile */
  67. //"className": "Sers.CL.Socket.ThreadWait.OrganizeClientBuilder",
  68. /* (x.2) config */
  69. /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */
  70. "host": "127.0.0.1",
  71. /* 服务端 监听端口号。例如: 4501 */
  72. "port": 4501
  73. },
  74. {
  75. // Zmq.ThreadWait
  76. /* (x.1) type */
  77. /* 在此Assembly中查找builder */
  78. "assemblyFile": "Sers.CL.ClrZmq.ThreadWait.dll",
  79. /* the class of builder in assemblyFile */
  80. //"className": "Sers.CL.ClrZmq.ThreadWait.OrganizeClientBuilder",
  81. /* (x.2) config */
  82. /* 地址。例如: "tcp://127.0.0.1:4502" 、 "ipc://4502" */
  83. "endpoint": "tcp://127.0.0.1:4502"
  84. },
  85. {
  86. // WebSocket
  87. /* (x.1) type */
  88. /* 在此Assembly中查找builder */
  89. "assemblyFile": "Sers.CL.WebSocket.dll",
  90. /* the class of builder in assemblyFile */
  91. //"className": "Sers.CL.WebSocket.OrganizeClientBuilder",
  92. /* (x.2) config */
  93. /* 服务端地址(默认为 "ws://127.0.0.1:4503") */
  94. "host": "ws://127.0.0.1:4503"
  95. },
  96. {
  97. // Zmq.FullDuplex
  98. /* (x.1) type */
  99. /* 在此Assembly中查找builder */
  100. "assemblyFile": "Sers.CL.Zmq.FullDuplex.dll",
  101. /* the class of builder in assemblyFile */
  102. //"className": "Sers.CL.Zmq.FullDuplex.OrganizeClientBuilder",
  103. /* (x.2) config */
  104. /* 地址。例如: "tcp://127.0.0.1:4504" 、 "ipc://4504" */
  105. "endpoint": "tcp://127.0.0.1:4504"
  106. },
  107. {
  108. // Ipc.SharedMemory
  109. /* (x.1) type */
  110. /* 在此Assembly中查找builder */
  111. "assemblyFile": "Sers.CL.Ipc.SharedMemory.dll",
  112. /* the class of builder in assemblyFile */
  113. //"className": "Sers.CL.Ipc.SharedMemory.OrganizeClientBuilder",
  114. /* (x.2) config */
  115. /* 共享内存名称。例如: "ipcTest" */
  116. "name": "ipcForStationDemo"
  117. }
  118. ]
  119. }
  120. },
  121. "PressureTest": {
  122. "clientCount": 1,
  123. "requestThreadCount": 40000,
  124. "messageThreadCount": 0,
  125. "msgLen": 1
  126. },
  127. /* Vit工具配置,可不指定 */
  128. "Vit": {
  129. /* 队列模式,可不指定。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) */
  130. "ConsumerMode": "ConsumerCache_BlockingCollection"
  131. }
  132. }