mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-20 00:39:01 +08:00
perf: control ws write buffer (#1451)
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
This commit is contained in:
@@ -27,6 +27,8 @@ type (
|
||||
handshakeTimeout time.Duration
|
||||
// 允许消息最大长度
|
||||
messageMaxMsgLength int
|
||||
// websocket write buffer, default: 4096, 4kb.
|
||||
writeBufferSize int
|
||||
}
|
||||
)
|
||||
|
||||
@@ -53,3 +55,9 @@ func WithMessageMaxMsgLength(length int) Option {
|
||||
opt.messageMaxMsgLength = length
|
||||
}
|
||||
}
|
||||
|
||||
func WithWriteBufferSize(size int) Option {
|
||||
return func(opt *configs) {
|
||||
opt.writeBufferSize = size
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user