always timeout for writeFrame

This commit is contained in:
xtaci
2023-02-14 20:33:47 +08:00
parent f8f99c6782
commit dbf64f502a
+1 -1
View File
@@ -519,7 +519,7 @@ func (s *Session) sendLoop() {
// writeFrame writes the frame to the underlying connection
// and returns the number of bytes written if successful
func (s *Session) writeFrame(f Frame) (n int, err error) {
return s.writeFrameInternal(f, nil, 0)
return s.writeFrameInternal(f, time.After(s.config.KeepAliveTimeout), 0)
}
// internal writeFrame version to support deadline used in keepalive