123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- {
- "Sers": {
- /* 通讯层配置 */
- "CL": {
- /* 共用配置,子项共用,覆写子项未指定的配置 */
- "Config": {
- /* 请求超时时间(单位ms,默认300000) */
- "requestTimeoutMs": 300000,
- /* 后台处理消息的线程个数(单位个,默认2) */
- "workThreadCount": 4,
- //HeartBeat
- /* 心跳检测超时时间(单位ms,默认30000) */
- "heartBeatTimeoutMs": 30000,
- /* 心跳检测失败重试次数(单位次,默认10) */
- "heartBeatRetryCount": 10,
- /* 心跳检测时间间隔(单位ms,默认10000,若指定为0则不进行心跳检测) */
- "heartBeatIntervalMs": 10000,
- /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
- "secretKey": "SersCL"
- },
- /* one conn is one channel.can be multiable */
- "Client": [
- {
- // Ipc.NamedPipe
- /* (x.1) type */
- /* 在此Assembly中查找builder */
- "assemblyFile": "Sers.CL.Ipc.NamedPipe.dll",
- /* the class of builder in assemblyFile */
- //"className": "Sers.CL.Ipc.NamedPipe.OrganizeClientBuilder",
- /* (x.2) config */
- // 命名管道只支持本机或局域网。
- /* 服务端机器名或者ip地址(如 103.23.23.23 、win10f),默认 "." */
- "serverName": ".",
- /* 命名管道名称。例如: "Sers.CL.Ipc" */
- "pipeName": "Sers.CL.Ipc"
- },
- {
- // Socket.Iocp
- /* (x.1) type */
- /* 在此Assembly中查找builder */
- "assemblyFile": "Sers.CL.Socket.Iocp.dll",
- /* the class of builder in assemblyFile */
- "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
- /* 通信模式(默认值:Simple)。可为 Simple、Timer、SpinWait */
- "mode": "Timer",
- /* 接收缓存区大小(单位:byte,默认:8192) */
- "receiveBufferSize": 8192,
- /* 发送缓冲区刷新间隔(单位:毫秒,默认:1)(仅当mode为Timer和SpinWait时有效) */
- "sendFlushInterval": 1,
- /* 发送缓冲区数据块的最小大小(单位:byte,默认 1000000)(仅当mode为Timer和SpinWait时有效) */
- "sendBufferSize": 1000000,
- /* 发送缓冲区个数(默认1024)(仅当mode为Timer和SpinWait时有效) */
- "sendBufferCount": 1024,
- /* (x.2) config */
- /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */
- //"host": "192.168.10.11",
- "host": "127.0.0.1",
- /* 服务端 监听端口号。例如: 4501 */
- "port": 4501
- },
- {
- // Socket.ThreadWait
- /* (x.1) type */
- /* 在此Assembly中查找builder */
- "assemblyFile": "Sers.CL.Socket.ThreadWait.dll",
- /* the class of builder in assemblyFile */
- //"className": "Sers.CL.Socket.ThreadWait.OrganizeClientBuilder",
- /* (x.2) config */
- /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */
- "host": "127.0.0.1",
- /* 服务端 监听端口号。例如: 4501 */
- "port": 4501
- },
- {
- // Zmq.ThreadWait
- /* (x.1) type */
- /* 在此Assembly中查找builder */
- "assemblyFile": "Sers.CL.ClrZmq.ThreadWait.dll",
- /* the class of builder in assemblyFile */
- //"className": "Sers.CL.ClrZmq.ThreadWait.OrganizeClientBuilder",
- /* (x.2) config */
- /* 地址。例如: "tcp://127.0.0.1:4502" 、 "ipc://4502" */
- "endpoint": "tcp://127.0.0.1:4502"
- },
- {
- // WebSocket
- /* (x.1) type */
- /* 在此Assembly中查找builder */
- "assemblyFile": "Sers.CL.WebSocket.dll",
- /* the class of builder in assemblyFile */
- //"className": "Sers.CL.WebSocket.OrganizeClientBuilder",
- /* (x.2) config */
- /* 服务端地址(默认为 "ws://127.0.0.1:4503") */
- "host": "ws://127.0.0.1:4503"
- },
- {
- // Zmq.FullDuplex
- /* (x.1) type */
- /* 在此Assembly中查找builder */
- "assemblyFile": "Sers.CL.Zmq.FullDuplex.dll",
- /* the class of builder in assemblyFile */
- //"className": "Sers.CL.Zmq.FullDuplex.OrganizeClientBuilder",
- /* (x.2) config */
- /* 地址。例如: "tcp://127.0.0.1:4504" 、 "ipc://4504" */
- "endpoint": "tcp://127.0.0.1:4504"
- },
- {
- // Ipc.SharedMemory
- /* (x.1) type */
- /* 在此Assembly中查找builder */
- "assemblyFile": "Sers.CL.Ipc.SharedMemory.dll",
- /* the class of builder in assemblyFile */
- //"className": "Sers.CL.Ipc.SharedMemory.OrganizeClientBuilder",
- /* (x.2) config */
- /* 共享内存名称。例如: "ipcTest" */
- "name": "ipcForStationDemo"
- }
- ]
- }
- },
- "PressureTest": {
- "clientCount": 1,
- "requestThreadCount": 40000,
- "messageThreadCount": 0,
- "msgLen": 1
- },
- /* Vit工具配置,可不指定 */
- "Vit": {
- /* 队列模式,可不指定。可为 BlockingCollection(默认)、 ConsumerCache_BlockingCollection(高性能) */
- "ConsumerMode": "ConsumerCache_BlockingCollection"
- }
- }
|