Skip to content

Commit

Permalink
increase frame size (#2739)
Browse files Browse the repository at this point in the history
  • Loading branch information
gelfand authored Sep 28, 2021
1 parent 9848028 commit 2e086bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpc/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
wsWriteBuffer = 1024
wsPingInterval = 60 * time.Second
wsPingWriteTimeout = 5 * time.Second
wsMessageSizeLimit = 15 * 1024 * 1024
wsMessageSizeLimit = 32 * 1024 * 1024
)

var wsBufferPool = new(sync.Pool)
Expand All @@ -47,7 +47,7 @@ var wsBufferPool = new(sync.Pool)
// allowedOrigins should be a comma-separated list of allowed origin URLs.
// To allow connections with any origin, pass "*".
func (s *Server) WebsocketHandler(allowedOrigins []string, compression bool) http.Handler {
var upgrader = websocket.Upgrader{
upgrader := websocket.Upgrader{
EnableCompression: compression,
ReadBufferSize: wsReadBuffer,
WriteBufferSize: wsWriteBuffer,
Expand Down Expand Up @@ -272,7 +272,7 @@ func (wc *websocketCodec) writeJSON(ctx context.Context, v interface{}) error {

// pingLoop sends periodic ping frames when the connection is idle.
func (wc *websocketCodec) pingLoop() {
var timer = time.NewTimer(wsPingInterval)
timer := time.NewTimer(wsPingInterval)
defer wc.wg.Done()
defer timer.Stop()

Expand Down

0 comments on commit 2e086bc

Please sign in to comment.