EasyServerConfig class
服务端配置
- Inheritance
-
- Object
- EasyConfig
- EasyServerConfig
Constructors
-
EasyServerConfig({EasyLogHandler? logger, EasyLogLevel? logLevel, String? logTag, String? logFilePath, int? logFileBackup, int? logFileMaxBytes, required String host, required int port, String? pwd, String secret = 'secret', bool binary = false, int heart = 60 * 1000, int timeout = 60 * 1000 * 3, int reqIdCache = 32, String reqIpHeader = 'x-forwarded-for', int gzipLevel = 4, int gzipMinBytes = 512, List<
String> gzipNotContentTypes = const [], String xPoweredByHeader = 'shelf_easy', Map<String, String> ? httpHeaders, String? sslKeyFile, String? sslKeyPasswd, String? sslCerFile, String? sslCerPasswd, int? backlog, List<String> ? links, EasyUniDbConfig? uniDbConfig, int isolateInstances = 1}) - EasyServerConfig.fromClusterNodeConfig({required EasyClusterNodeConfig serverConfig, required EasyClusterNodeConfig? globalConfig, required String defaultLogTag, required String defaultLogFilePath})
-
factory
Properties
- backlog → int?
-
与TCP并发连接有关,参考文献:https://blog.csdn.net/daocaokafei/article/details/115336575
final
- binary → bool
-
为true时使用二进制收发数据,为false时使用字符串收发数据
final
-
clusterLinksConfigs
→ Map<
String, List< EasyServerConfig> > -
集群节点需要远程连接的集群分组配置信息,启动后自动通过initClusterLinksConfigs方法进行初始化
final
- gzipLevel → int
-
响应数据的gzip压缩级别,
final
- gzipMinBytes → int
-
响应数据的gzip压缩最小字节
final
-
gzipNotContentTypes
→ List<
String> -
响应数据的gzip压缩需忽略类型
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- heart → int
-
心跳检测周期(毫秒)
final
- host → String
-
监听域名
final
-
httpHeaders
→ Map<
String, String> ? -
响应数据的额外header信息
final
- httpUrl → String
-
http请求地址
no setter
- isolateInstances → int
-
集群节点启动隔离线程的数量,建议只对web服务设置设置该值>1,因为websocket服务每个session是有状态的
final
-
links
→ List<
String> ? -
需要远程连接的集群分组
final
- logFileBackup → int?
-
日志文件保存数量
finalinherited
- logFileMaxBytes → int?
-
日志文件每份大小(字节)
finalinherited
- logFilePath → String?
-
日志输出文件路径
finalinherited
- logger → EasyLogHandler?
-
日志处理方法
finalinherited
- logLevel → EasyLogLevel?
-
日志级别
finalinherited
- logTag → String?
-
日志标签
finalinherited
- port → int
-
监听端口号
final
- pwd → String?
-
数据加解密密码,为null时不启用数据加解密
final
- reqIdCache → int
-
校验重复包的包id缓存数量
final
- reqIpHeader → String
-
从请求获取ip地址的请求头
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secret → String
-
内部通讯数据包签名验签密钥
final
- sslCerFile → String?
-
ssl模式cer文件路径
final
- sslCerPasswd → String?
-
ssl模式cer文件密码
final
- sslEnable → bool
-
为true时启用ssl证书模式
no setter
- sslKeyFile → String?
-
ssl模式key文件路径
final
- sslKeyPasswd → String?
-
ssl模式key文件密码
final
- timeout → int
-
两个心跳包之间的最大间隔时间(毫秒)
final
- uniDbConfig → EasyUniDbConfig?
-
数据库配置信息
final
- websocketUrl → String
-
websocket连接地址
no setter
- xPoweredByHeader → String
-
响应数据的X-Powered-By信息
final
Methods
-
initClusterLinksConfigs(
Map< String, List< clusterServerConfigs) → voidEasyServerConfig> > - 初始化需要远程连接的集群分组配置信息
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited