added the keepalive support from the client side
This commit is contained in:
@@ -92,9 +92,11 @@ type RPCServiceConfig struct { // rpc server-side configuration
|
||||
}
|
||||
|
||||
type RPCEndpointConfig struct { // rpc client-side configuration
|
||||
Authority string `yaml:"authority"`
|
||||
Addrs []string `yaml:"addresses"`
|
||||
SeedTmout time.Duration `yaml:"seed-timeout"`
|
||||
Authority string `yaml:"authority"`
|
||||
Addrs []string `yaml:"addresses"`
|
||||
PingIntvl time.Duration `yaml:"ping-interval"`
|
||||
PingTmout time.Duration `yaml:"ping-timeout"`
|
||||
SeedTmout time.Duration `yaml:"seed-timeout"`
|
||||
}
|
||||
|
||||
type ServerAppConfig struct {
|
||||
@@ -122,6 +124,9 @@ type ClientAppConfig struct {
|
||||
TokenFile string `yaml:"token-file"`
|
||||
PtyUser string `yaml:"pty-user"`
|
||||
PtyShell string `yaml:"pty-shell"`
|
||||
RpcPingIntvl time.Duration `yaml:"rpc-ping-interval"`
|
||||
RpcPingTmout time.Duration `yaml:"rpc-ping-timeout"`
|
||||
RpcSeedTmout time.Duration `yaml:"rpc-seed-timeout"`
|
||||
XtermHtmlFile string `yaml:"xterm-html-file"`
|
||||
}
|
||||
|
||||
|
||||
@@ -297,6 +297,8 @@ func client_main(ctl_addrs []string, rpc_addrs []string, route_configs []string,
|
||||
config.CtlAuth, err = make_http_auth_config(&cfg.CTL.Service.Auth)
|
||||
if err != nil { return err }
|
||||
|
||||
cc.ServerPingIntvl = cfg.RPC.Endpoint.PingIntvl
|
||||
cc.ServerPingTmout = cfg.RPC.Endpoint.PingTmout
|
||||
cc.ServerSeedTmout = cfg.RPC.Endpoint.SeedTmout
|
||||
cc.ServerAuthority = cfg.RPC.Endpoint.Authority
|
||||
pty_user = cfg.APP.PtyUser
|
||||
@@ -306,6 +308,10 @@ func client_main(ctl_addrs []string, rpc_addrs []string, route_configs []string,
|
||||
config.PeerConnMax = cfg.APP.MaxPeers
|
||||
config.PeerConnTmout = cfg.APP.PeerConnTmout
|
||||
|
||||
config.RpcPingIntvl = cfg.APP.RpcPingIntvl // app-level default
|
||||
config.RpcPingTmout = cfg.APP.RpcPingTmout // app-level default
|
||||
config.RpcSeedTmout = cfg.APP.RpcSeedTmout // app-level default
|
||||
|
||||
if cfg.APP.TokenText != "" {
|
||||
config.Token = cfg.APP.TokenText
|
||||
} else if cfg.APP.TokenFile != "" {
|
||||
|
||||
Reference in New Issue
Block a user