DrainTx removes pending tx bytes and returns them as a sequence of frames, each capped at maxPayload bytes. Emits a SYN frame first if needed, and a trailing FIN frame if RequestClose was called and the FIN hasn't been sent yet.
(maxPayload int)
| 267 | // each capped at maxPayload bytes. Emits a SYN frame first if needed, and a |
| 268 | // trailing FIN frame if RequestClose was called and the FIN hasn't been sent yet. |
| 269 | func (s *Session) DrainTx(maxPayload int) []*frame.Frame { |
| 270 | frames, _ := s.drainTx(maxPayload, 0, false) |
| 271 | return frames |
| 272 | } |
| 273 | |
| 274 | // DrainTxLimited is like DrainTx but emits at most maxFrames frames in one |
| 275 | // call (0 means unlimited). Remaining bytes stay queued for later polls. |