Check client disconnect to exit for loop (api). Fixes #1983 (#2012)

Also update to latest melody upstream
This commit is contained in:
Wim
2023-03-11 18:14:49 +01:00
committed by GitHub
parent 356ada872c
commit 89e2dbac15
17 changed files with 278 additions and 254 deletions

22
vendor/github.com/olahol/melody/config.go generated vendored Normal file
View File

@@ -0,0 +1,22 @@
package melody
import "time"
// Config melody configuration struct.
type Config struct {
WriteWait time.Duration // Milliseconds until write times out.
PongWait time.Duration // Timeout for waiting on pong.
PingPeriod time.Duration // Milliseconds between pings.
MaxMessageSize int64 // Maximum size in bytes of a message.
MessageBufferSize int // The max amount of messages that can be in a sessions buffer before it starts dropping them.
}
func newConfig() *Config {
return &Config{
WriteWait: 10 * time.Second,
PongWait: 60 * time.Second,
PingPeriod: (60 * time.Second * 9) / 10,
MaxMessageSize: 512,
MessageBufferSize: 256,
}
}