code: func (r *eofSignal) Read(buf []byte) (int, error) {
  	if r.count == 0 {
  		if r.eof != nil {
  			r.eof <- struct{}{}
  			r.eof = nil
  		}
  		return 0, io.EOF
  	}
  
  	max := len(buf)
  	if int(r.count) < len(buf) {
  		max = int(r.count)
  	}
  	n, err := r.wrapped.Read(buf[:max])
  	r.count -= uint32(n)
  	if (err != nil || r.count == 0) && r.eof != nil {
  		r.eof <- struct{}{} // tell Peer that msg has been consumed
  		r.eof = nil
  	}
  	return n, err
  }
docs: // note: when using eofSignal to detect whether a message payload
  // has been read, Read might not be called for zero sized messages.