func (wc *writeConn) writeUser(writer *chain.ConnWriter, payload interface{}, seqno SeqNo, err error) (continueWriteLoop bool) {
	if err == io.EOF {
		// We've reached the EOF of the user write sequence.
		// Go back to listen for more reads from the buffer, in case a sync rewinds the buffer cursor.
		return true
	}
	if err == io.ErrUnexpectedEOF {
		// An unexpected termination has been reached, indicated by killing the buffer; nothing to send any longer.
		return false
	}
	if err != nil {
		panic("u")
	}
	// Encode chunk
	chunk := payload.(*Chunk)
	chunk.seqno = seqno // Sequence numbers are assigned 0-based integers
	raw, err := chunk.Encode()
	if err != nil {
		panic(err)
	}
	writer.Write(raw)
	// If connection is closed (no more writes) and the buffer is empty, it is time to kill the connection.
	if wc.bfr.Drained() {
		return false
	}
	return true
}
// writeUser processes a single set of return values from Buffer.Read.
writeUser processes a single set of return values from Buffer.Read.
// writeUser processes a single set of return values from Buffer . Read .
func (wc *writeConn) writeUser(writer *chain.ConnWriter, payload interface{}, seqno SeqNo, err error) (continueWriteLoop bool) {
	if err == io.EOF {
		return true
	}
	if err == io.ErrUnexpectedEOF {
		return false
	}
	if err != nil {
		panic("u")
	}
	chunk := payload.(*Chunk)
	chunk.seqno = seqno 
	raw, err := chunk.Encode()
	if err != nil {
		panic(err)
	}
	writer.Write(raw)
	if wc.bfr.Drained() {
		return false
	}
	return true
}
func ( wc * writeConn ) writeUser ( writer * chain . ConnWriter , payload interface { } , seqno SeqNo , err error ) ( continueWriteLoop bool ) { if err == io . EOF { return true } if err == io . ErrUnexpectedEOF { return false } if err != nil { panic ( " " ) } chunk := payload . ( * Chunk ) chunk . seqno = seqno raw , err := chunk . Encode ( ) if err != nil { panic ( err ) } writer . Write ( raw ) if wc . bfr . Drained ( ) { return false } return true }
writeUser processes a single set of return values from Buffer.Read.
writeUser processes a single set of return values from Buffer . Read .
// We've reached the EOF of the user write sequence. // Go back to listen for more reads from the buffer, in case a sync rewinds the buffer cursor. // An unexpected termination has been reached, indicated by killing the buffer; nothing to send any longer. // Encode chunk // Sequence numbers are assigned 0-based integers // If connection is closed (no more writes) and the buffer is empty, it is time to kill the connection.