func (w *reqResWriter) flushFragment(fragment *writableFragment) error {
	if w.err != nil {
		return w.err
	}

	frame := fragment.frame.(*Frame)
	frame.Header.SetPayloadSize(uint16(fragment.contents.BytesWritten()))

	if err := w.mex.checkError(); err != nil {
		return w.failed(err)
	}
	select {
	case <-w.mex.ctx.Done():
		return w.failed(GetContextError(w.mex.ctx.Err()))
	case <-w.mex.errCh.c:
		return w.failed(w.mex.errCh.err)
	case w.conn.sendCh <- frame:
		return nil
	}
}
func (w *reqResWriter) flushFragment(fragment *writableFragment) error {
	if w.err != nil {
		return w.err
	}

	frame := fragment.frame.(*Frame)
	frame.Header.SetPayloadSize(uint16(fragment.contents.BytesWritten()))

	if err := w.mex.checkError(); err != nil {
		return w.failed(err)
	}
	select {
	case <-w.mex.ctx.Done():
		return w.failed(GetContextError(w.mex.ctx.Err()))
	case <-w.mex.errCh.c:
		return w.failed(w.mex.errCh.err)
	case w.conn.sendCh <- frame:
		return nil
	}
}
func ( w * reqResWriter ) flushFragment ( fragment * writableFragment ) error { if w . err != nil { return w . err } frame := fragment . frame . ( * Frame ) frame . Header . SetPayloadSize ( uint16 ( fragment . contents . BytesWritten ( ) ) ) if err := w . mex . checkError ( ) ; err != nil { return w . failed ( err ) } select { case <- w . mex . ctx . Done ( ) : return w . failed ( GetContextError ( w . mex . ctx . Err ( ) ) ) case <- w . mex . errCh . c : return w . failed ( w . mex . errCh . err ) case w . conn . sendCh <- frame : return nil } }
// flushFragment sends a fragment to the peer over the connection
flushFragment sends a fragment to the peer over the connection