diff --git a/api/client.go b/api/client.go index 5bbad8f8c76dbcafc87b9f50955339a5decaa5d2..a81bb25352dd90926a2cce68c6601a5f847fcc8e 100644 --- a/api/client.go +++ b/api/client.go @@ -30,6 +30,7 @@ import ( "gitlab.com/xx_network/crypto/signature/rsa" "gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/ndf" + "math" "sync" "time" ) @@ -235,6 +236,8 @@ func Login(storageDir string, password []byte, parameters params.Network) (*Clie if def.Notification.Address != "" { hp := connect.GetDefaultHostParams() + // Client will not send KeepAlive packets + hp.KaClientOpts.Time = time.Duration(math.MaxInt64) hp.AuthEnabled = false hp.MaxRetries = 5 _, err = c.comms.AddHost(&id.NotificationBot, def.Notification.Address, []byte(def.Notification.TlsCertificate), hp) @@ -392,11 +395,10 @@ func (c *Client) StartNetworkFollower(timeout time.Duration) (<-chan interfaces. jww.INFO.Printf("StartNetworkFollower() \n\tTransmisstionID: %s "+ "\n\tReceptionID: %s", u.TransmissionID, u.ReceptionID) - if status := c.status.get(); status != Stopped{ + if status := c.status.get(); status != Stopped { return nil, errors.Errorf("Cannot Stop the Network Follower when it is not running, status: %s", status) } - c.clientErrorChannel = make(chan interfaces.ClientError, 1000) cer := func(source, message, trace string) { @@ -456,7 +458,7 @@ func (c *Client) StopNetworkFollower() error { c.followerLock.Lock() defer c.followerLock.Unlock() - if status := c.status.get(); status != Running{ + if status := c.status.get(); status != Running { return errors.Errorf("Cannot Stop the Network Follower when it is not running, status: %s", status) } diff --git a/ud/manager.go b/ud/manager.go index f3b7afc643c27af41d2d1591de2ff89755c6104d..1397b8e2d8d8acc7081c307ef3ea2610e1aaae1c 100644 --- a/ud/manager.go +++ b/ud/manager.go @@ -15,6 +15,7 @@ import ( "gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/crypto/signature/rsa" "gitlab.com/xx_network/primitives/id" + "math" "time" ) @@ -89,6 +90,8 @@ func NewManager(client *api.Client, single *single.Manager) (*Manager, error) { // Create the user discovery host object hp := connect.GetDefaultHostParams() + // Client will not send KeepAlive packets + hp.KaClientOpts.Time = time.Duration(math.MaxInt64) hp.MaxRetries = 3 hp.SendTimeout = 3 * time.Second m.host, err = m.comms.AddHost(&id.UDB, def.UDB.Address, []byte(def.UDB.Cert), hp)