diff --git a/read.go b/read.go index c19f41de..70ffe093 100644 --- a/read.go +++ b/read.go @@ -300,7 +300,7 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) { return err } - ctx, cancel := context.WithTimeout(ctx, time.Second*5) + ctx, cancel := context.WithTimeout(ctx, time.Second*20) defer cancel() b := c.readControlBuf[:h.payloadLength] diff --git a/write.go b/write.go index 81bab4fa..e197b675 100644 --- a/write.go +++ b/write.go @@ -274,7 +274,7 @@ func (mw *msgWriter) close() { } func (c *Conn) writeControl(ctx context.Context, opcode opcode, p []byte) error { - ctx, cancel := context.WithTimeout(ctx, time.Second*5) + ctx, cancel := context.WithTimeout(ctx, time.Second*20) defer cancel() _, err := c.writeFrame(ctx, true, false, opcode, p)