Skip to content
Snippets Groups Projects
Commit 6e5c4351 authored by Jake Taylor's avatar Jake Taylor
Browse files

added Keepalive opts

parent f8e2553b
Branches
Tags
1 merge request!23Release
...@@ -30,6 +30,7 @@ import ( ...@@ -30,6 +30,7 @@ import (
"gitlab.com/xx_network/crypto/signature/rsa" "gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/ndf" "gitlab.com/xx_network/primitives/ndf"
"math"
"sync" "sync"
"time" "time"
) )
...@@ -235,6 +236,8 @@ func Login(storageDir string, password []byte, parameters params.Network) (*Clie ...@@ -235,6 +236,8 @@ func Login(storageDir string, password []byte, parameters params.Network) (*Clie
if def.Notification.Address != "" { if def.Notification.Address != "" {
hp := connect.GetDefaultHostParams() hp := connect.GetDefaultHostParams()
// Client will not send KeepAlive packets
hp.KaClientOpts.Time = time.Duration(math.MaxInt64)
hp.AuthEnabled = false hp.AuthEnabled = false
hp.MaxRetries = 5 hp.MaxRetries = 5
_, err = c.comms.AddHost(&id.NotificationBot, def.Notification.Address, []byte(def.Notification.TlsCertificate), hp) _, err = c.comms.AddHost(&id.NotificationBot, def.Notification.Address, []byte(def.Notification.TlsCertificate), hp)
...@@ -396,7 +399,6 @@ func (c *Client) StartNetworkFollower(timeout time.Duration) (<-chan interfaces. ...@@ -396,7 +399,6 @@ func (c *Client) StartNetworkFollower(timeout time.Duration) (<-chan interfaces.
return nil, errors.Errorf("Cannot Stop the Network Follower when it is not running, status: %s", status) return nil, errors.Errorf("Cannot Stop the Network Follower when it is not running, status: %s", status)
} }
c.clientErrorChannel = make(chan interfaces.ClientError, 1000) c.clientErrorChannel = make(chan interfaces.ClientError, 1000)
cer := func(source, message, trace string) { cer := func(source, message, trace string) {
......
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
"gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/crypto/signature/rsa" "gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"math"
"time" "time"
) )
...@@ -89,6 +90,8 @@ func NewManager(client *api.Client, single *single.Manager) (*Manager, error) { ...@@ -89,6 +90,8 @@ func NewManager(client *api.Client, single *single.Manager) (*Manager, error) {
// Create the user discovery host object // Create the user discovery host object
hp := connect.GetDefaultHostParams() hp := connect.GetDefaultHostParams()
// Client will not send KeepAlive packets
hp.KaClientOpts.Time = time.Duration(math.MaxInt64)
hp.MaxRetries = 3 hp.MaxRetries = 3
hp.SendTimeout = 3 * time.Second hp.SendTimeout = 3 * time.Second
m.host, err = m.comms.AddHost(&id.UDB, def.UDB.Address, []byte(def.UDB.Cert), hp) m.host, err = m.comms.AddHost(&id.UDB, def.UDB.Address, []byte(def.UDB.Cert), hp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment