Skip to content

Commit bf0d5ac

Browse files
committed
add openCloseTimeout for stream open and close
1 parent 46a59b2 commit bf0d5ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

session.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
const (
1515
defaultAcceptBacklog = 1024
1616
maxShaperSize = 1024
17+
openCloseTimeout = 30 * time.Second // stream open/close timeout
1718
)
1819

1920
var (
@@ -514,7 +515,7 @@ func (s *Session) sendLoop() {
514515
// writeFrame writes the frame to the underlying connection
515516
// and returns the number of bytes written if successful
516517
func (s *Session) writeFrame(f Frame) (n int, err error) {
517-
return s.writeFrameInternal(f, time.After(s.config.KeepAliveTimeout), 0)
518+
return s.writeFrameInternal(f, time.After(openCloseTimeout), 0)
518519
}
519520

520521
// internal writeFrame version to support deadline used in keepalive

0 commit comments

Comments
 (0)