Browse Source

adding validation for the tpc keepalive client config

eric 10 years ago
parent
commit
8c2e14cb19
1 changed files with 2 additions and 0 deletions
  1. 2 0
      config.go

+ 2 - 0
config.go

@@ -190,6 +190,8 @@ func (c *Config) Validate() error {
 		return ConfigurationError("Invalid Net.ReadTimeout, must be > 0")
 	case c.Net.WriteTimeout <= 0:
 		return ConfigurationError("Invalid Net.WriteTimeout, must be > 0")
+	case c.Net.KeepAlive < 0:
+		return ConfigurationError("Invalid Net.KeepAlive, must be > 0")
 	}
 
 	// validate the Metadata values