code: func (cli *Client) receive() (packet.Packet, error) {
  	// Return an error if the Client has not yet connected to the Server.
  	if cli.conn == nil {
  		return nil, ErrNotYetConnected
  	}
  
  	// Get the first byte of the Packet.
  	b, err := cli.conn.r.ReadByte()
  	if err != nil {
  		return nil, err
  	}
  
  	// Create the Fixed header.
  	fixedHeader := packet.FixedHeader([]byte{b})
  
  	// Get and decode the Remaining Length.
  	var mp uint32 = 1 // multiplier
  	var rl uint32     // the Remaining Length
  	for {
  		// Get the next byte of the Packet.
  		b, err = cli.conn.r.ReadByte()
  		if err != nil {
  			return nil, err
  		}
  
  		fixedHeader = append(fixedHeader, b)
  
  		rl += uint32(b&0x7F) * mp
  
  		if b&0x80 == 0 {
  			break
  		}
  
  		mp *= 128
  	}
  
  	// Create the Remaining (the Variable header and the Payload).
  	remaining := make([]byte, rl)
  
  	if rl > 0 {
  		// Get the remaining of the Packet.
  		if _, err = io.ReadFull(cli.conn.r, remaining); err != nil {
  			return nil, err
  		}
  	}
  
  	// Create and return a Packet.
  	return packet.NewFromBytes(fixedHeader, remaining)
  }
docs: // receive receives an MQTT Control Packet from the Server.