{ "Sers": { /* 通讯层配置 */ "CL": { /* 共用配置,子项共用,覆写子项未指定的配置 */ "Config": { "workThread": { // 模式,可为 LongThread(默认)、LongThread_TimeLimit、ManagedThread、ConsumerCascade "mode": "LongThread", /* 后台处理消息的线程个数(单位个,默认2) */ "threadCount": 2, /* 最大线程数(包含常驻线程和临时线程),默认100。仅当mode为ManagedThread时有效 */ "maxThreadCount": 100, /* 等待队列的最大长度(默认:100000)。仅当mode为LongThread_TimeLimit和ManagedThread时有效 */ "pendingQueueLength": 100000, /* 超时时间(单位ms,默认300000),仅当mode为LongThread_TimeLimit、ManagedThread时有效 */ "timeoutMs": 300000 }, /* 请求超时时间(单位ms,默认300000) */ "requestTimeoutMs": 300000, /* 数据传输 加密协议,可多个,可不指定 */ "//security": [ { // SampleSecurity /* 在此Assembly中查找security */ "assemblyFile": "Sers.Core.dll", /* the class of security in assemblyFile. 必须继承接口 Sers.Core.Util.StreamSecurity.ISecurity */ "className": "Sers.Core.Util.StreamSecurity.Security.SampleSecurity", /* (x.2) config */ /* 加密密钥 */ "secret": "security" }, { // SampleSecurity /* 若不指定assemblyFile和className 则默认为Sers.Core.Util.StreamSecurity.Security.SampleSecurity */ "secret": "Two layer encryption" } ], /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */ "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.4501" }, { // Socket.Iocp /* (x.1) type - Iocp */ /* 在此Assembly中查找builder */ //"assemblyFile": "Sers.CL.Socket.Iocp.dll", /* the class of builder in assemblyFile */ "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder", /* 通信模式(默认值:Simple)。可为 Simple、Timer、ThreadWait */ //"mode": "ThreadWait", /* (x.2) config */ /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */ "host": "127.0.0.1", /* 服务端 监听端口号。例如: 4501 */ "port": 4501 }, { // Socket.ThreadWait /* (x.1) type - ThreadWait */ /* 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 - WebSocket */ /* 在此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", /* 是否校验服务端证书(使用wss时有效),default:true */ "//validateRemoteCertificate": false }, { // 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 - Ipc.SharedMemory */ /* 在此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": "ipcForRobot" } ] }, /* LocalApiService 配置,可不指定 */ "LocalApiService": { "workThread": { // 模式,可为 LongThread(默认)、LongThread_TimeLimit、ManagedThread、ConsumerCascade "mode": "LongThread", /* 后台服务的线程个数(单位个,默认16)(0代表不开启服务) */ "threadCount": 4, /* 最大线程数(包含常驻线程和临时线程),默认100。仅当mode为ManagedThread时有效 */ "maxThreadCount": 100, /* 等待队列的最大长度(默认:100000)。仅当mode为LongThread_TimeLimit和ManagedThread时有效 */ "pendingQueueLength": 100000, /* 超时时间(单位ms,默认300000),仅当mode为LongThread_TimeLimit、ManagedThread时有效 */ "timeoutMs": 300000 }, /* 静态文件映射器。映射站点静态文件,可多个,可不指定 */ "staticFiles": [ { /* api路由前缀,例如 "/demo/ui/*" */ "route": "/_robot_/*", /* api描述,静态文件描述 */ "apiName": "robot站点静态文件", /* 静态文件路径。可为相对路径或绝对路径。若为空或空字符串则为默认路径(wwwroot)。demo:"wwwroot/demo" */ "rootPath": "wwwroot/_robot_", /* 静态文件类型映射配置的文件路径。可为相对路径或绝对路径。例如"contentTypeMap.json"。若不指定(或指定的文件不存在)则不指定文件类型映射配置 */ "contentTypeMapFile": "contentTypeMap.json", /* 回应静态文件时额外添加的http回应头。可不指定。 */ "responseHeaders": { //设置浏览器静态文件缓存3600秒 "Cache-Control": "public,max-age=3600" } } ] }, /* ServiceStation配置,可不指定 */ "ServiceStation": { /* serviceStation站点信息 */ "serviceStationInfo": { "serviceStationName": "Robot" } } }, /* Vit工具配置,可不指定 */ "Vit": { /* 日志配置,可不指定 */ "Logger": { /* print the log to Log/*.txt default:true */ "PrintToTxt": true, /* print the log to console. default:true */ "PrintToConsole": true } } }