func (p *HalfConn) Close() error {
	if err := p.killWrite(); err != nil {
		return err
	}
	p.send__.Lock()
	defer p.send__.Unlock()
	if p.send == nil {
		return io.ErrUnexpectedEOF
	}
	// After a successful write to send, we are obligated to do one read from feedback.
	p.send <- eof{}
	if p.fbck != nil {
		<-p.fbck
	}
	close(p.send)
	p.send = nil
	return nil
}
// Close should be enqueued on the write path, so it doesn't interrupt pending writes
Close should be enqueued on the write path, so it doesn't interrupt pending writes
// Close should be enqueued on the write path so it doesn ' t interrupt pending writes
func (p *HalfConn) Close() error {
	if err := p.killWrite(); err != nil {
		return err
	}
	p.send__.Lock()
	defer p.send__.Unlock()
	if p.send == nil {
		return io.ErrUnexpectedEOF
	}
	p.send <- eof{}
	if p.fbck != nil {
		<-p.fbck
	}
	close(p.send)
	p.send = nil
	return nil
}
func ( p * HalfConn ) Close ( ) error { if err := p . killWrite ( ) ; err != nil { return err } p . send__ . Lock ( ) defer p . send__ . Unlock ( ) if p . send == nil { return io . ErrUnexpectedEOF } p . send <- eof { } if p . fbck != nil { <- p . fbck } close ( p . send ) p . send = nil return nil }
Close should be enqueued on the write path, so it doesn't interrupt pending writes
Close should be enqueued on the write path so it doesn ' t interrupt pending writes
// After a successful write to send, we are obligated to do one read from feedback.