support tcp stream multiplexing by smux

This commit is contained in:
fatedier
2017-05-17 17:47:20 +08:00
parent a5f06489cb
commit b600a07ec0
7 changed files with 153 additions and 50 deletions

View File

@ -36,6 +36,7 @@ type ClientCommonConf struct {
LogMaxDays int64
PrivilegeToken string
PoolCount int
TcpMux bool
User string
HeartBeatInterval int64
HeartBeatTimeout int64
@ -53,6 +54,7 @@ func GetDeaultClientCommonConf() *ClientCommonConf {
LogMaxDays: 3,
PrivilegeToken: "",
PoolCount: 1,
TcpMux: true,
User: "",
HeartBeatInterval: 30,
HeartBeatTimeout: 90,
@ -120,6 +122,13 @@ func LoadClientCommonConf(conf ini.File) (cfg *ClientCommonConf, err error) {
}
}
tmpStr, ok = conf.Get("common", "tcp_mux")
if ok && tmpStr == "false" {
cfg.TcpMux = false
} else {
cfg.TcpMux = true
}
tmpStr, ok = conf.Get("common", "user")
if ok {
cfg.User = tmpStr