Remove read deadlines from the connection.

Prevents the connection from closing from a lack of incoming messages.
This commit is contained in:
Jay
2026-04-15 17:43:26 -04:00
parent 031df8c98d
commit 9fb00c3a78
6 changed files with 20 additions and 226 deletions

View File

@@ -9,7 +9,6 @@ type CloseHandler func(code int, text string) error
type Config struct {
CloseHandler CloseHandler
ReadTimeout time.Duration
WriteTimeout time.Duration
Retry *RetryConfig
}
@@ -37,7 +36,6 @@ func NewConfig(options ...ConfigOption) (*Config, error) {
func GetDefaultConfig() *Config {
return &Config{
CloseHandler: nil,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
Retry: GetDefaultRetryConfig(),
}
@@ -80,17 +78,6 @@ func WithCloseHandler(handler CloseHandler) ConfigOption {
}
}
// When ReadTimeout is set to zero, read timeouts are disabled.
func WithReadTimeout(value time.Duration) ConfigOption {
return func(c *Config) error {
if value < 0 {
return errors.InvalidReadTimeout
}
c.ReadTimeout = value
return nil
}
}
// When WriteTimeout is set to zero, read timeouts are disabled.
func WithWriteTimeout(value time.Duration) ConfigOption {
return func(c *Config) error {